Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
484e8767
Kaydet (Commit)
484e8767
authored
May 03, 2002
tarafından
Andreas Schlüns
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
#99021# support XDispatchProvider interface
üst
2b7abf48
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
167 additions
and
58 deletions
+167
-58
mailtodispatcher.hxx
framework/inc/dispatch/mailtodispatcher.hxx
+13
-2
servicehandler.hxx
framework/inc/dispatch/servicehandler.hxx
+14
-3
mailtodispatcher.cxx
framework/source/dispatch/mailtodispatcher.cxx
+74
-31
servicehandler.cxx
framework/source/dispatch/servicehandler.cxx
+66
-22
No files found.
framework/inc/dispatch/mailtodispatcher.hxx
Dosyayı görüntüle @
484e8767
...
...
@@ -2,9 +2,9 @@
*
* $RCSfile: mailtodispatcher.hxx,v $
*
* $Revision: 1.
2
$
* $Revision: 1.
3
$
*
* last change: $Author: as $ $Date: 2002-05-0
2 11:40:1
5 $
* last change: $Author: as $ $Date: 2002-05-0
3 08:01:4
5 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
...
...
@@ -114,6 +114,10 @@
#include <com/sun/star/frame/XDispatch.hpp>
#endif
#ifndef _COM_SUN_STAR_FRAME_XDISPATCHPROVIDER_HPP_
#include <com/sun/star/frame/XDispatchProvider.hpp>
#endif
#ifndef _COM_SUN_STAR_UTIL_URL_HPP_
#include <com/sun/star/util/URL.hpp>
#endif
...
...
@@ -165,6 +169,7 @@ namespace framework{
class
MailToDispatcher
:
// interfaces
public
css
::
lang
::
XTypeProvider
,
public
css
::
lang
::
XServiceInfo
,
public
css
::
frame
::
XDispatchProvider
,
public
css
::
frame
::
XNotifyingDispatch
,
// => XDispatch
// baseclasses
// Order is neccessary for right initialization!
...
...
@@ -189,6 +194,12 @@ class MailToDispatcher : // interfaces
DECLARE_XTYPEPROVIDER
DECLARE_XSERVICEINFO
// XDispatchProvider
virtual
css
::
uno
::
Reference
<
css
::
frame
::
XDispatch
>
SAL_CALL
queryDispatch
(
const
css
::
util
::
URL
&
aURL
,
const
::
rtl
::
OUString
&
sTarget
,
sal_Int32
nFlags
)
throw
(
css
::
uno
::
RuntimeException
);
virtual
css
::
uno
::
Sequence
<
css
::
uno
::
Reference
<
css
::
frame
::
XDispatch
>
>
SAL_CALL
queryDispatches
(
const
css
::
uno
::
Sequence
<
css
::
frame
::
DispatchDescriptor
>&
lDescriptor
)
throw
(
css
::
uno
::
RuntimeException
);
// XNotifyingDispatch
virtual
void
SAL_CALL
dispatchWithNotification
(
const
css
::
util
::
URL
&
aURL
,
const
css
::
uno
::
Sequence
<
css
::
beans
::
PropertyValue
>&
lArguments
,
...
...
framework/inc/dispatch/servicehandler.hxx
Dosyayı görüntüle @
484e8767
...
...
@@ -2,9 +2,9 @@
*
* $RCSfile: servicehandler.hxx,v $
*
* $Revision: 1.
1
$
* $Revision: 1.
2
$
*
* last change: $Author: as $ $Date: 2002-05-0
2 11:36:04
$
* last change: $Author: as $ $Date: 2002-05-0
3 08:01:46
$
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
...
...
@@ -114,6 +114,10 @@
#include <com/sun/star/frame/XDispatch.hpp>
#endif
#ifndef _COM_SUN_STAR_FRAME_XDISPATCHPROVIDER_HPP_
#include <com/sun/star/frame/XDispatchProvider.hpp>
#endif
#ifndef _COM_SUN_STAR_UTIL_URL_HPP_
#include <com/sun/star/util/URL.hpp>
#endif
...
...
@@ -150,7 +154,7 @@ namespace framework{
/**
@short protocol handler for "service:*" URLs
@descr It's a special dispatch object which is registered for such URL pattern and will
@descr It's a special dispatch
/provider
object which is registered for such URL pattern and will
be automaticly used by the framework dispatch mechanism if such URL occured.
His job is to create any registered uno components which must be coded inside
dispatched URL (may with some optional given parameters). After that such created
...
...
@@ -169,6 +173,7 @@ namespace framework{
class
ServiceHandler
:
// interfaces
public
css
::
lang
::
XTypeProvider
,
public
css
::
lang
::
XServiceInfo
,
public
css
::
frame
::
XDispatchProvider
,
public
css
::
frame
::
XNotifyingDispatch
,
// => XDispatch
// baseclasses
// Order is neccessary for right initialization!
...
...
@@ -193,6 +198,12 @@ class ServiceHandler : // interfaces
DECLARE_XTYPEPROVIDER
DECLARE_XSERVICEINFO
// XDispatchProvider
virtual
css
::
uno
::
Reference
<
css
::
frame
::
XDispatch
>
SAL_CALL
queryDispatch
(
const
css
::
util
::
URL
&
aURL
,
const
::
rtl
::
OUString
&
sTarget
,
sal_Int32
nFlags
)
throw
(
css
::
uno
::
RuntimeException
);
virtual
css
::
uno
::
Sequence
<
css
::
uno
::
Reference
<
css
::
frame
::
XDispatch
>
>
SAL_CALL
queryDispatches
(
const
css
::
uno
::
Sequence
<
css
::
frame
::
DispatchDescriptor
>&
lDescriptor
)
throw
(
css
::
uno
::
RuntimeException
);
// XNotifyingDispatch
virtual
void
SAL_CALL
dispatchWithNotification
(
const
css
::
util
::
URL
&
aURL
,
const
css
::
uno
::
Sequence
<
css
::
beans
::
PropertyValue
>&
lArguments
,
...
...
framework/source/dispatch/mailtodispatcher.cxx
Dosyayı görüntüle @
484e8767
...
...
@@ -2,9 +2,9 @@
*
* $RCSfile: mailtodispatcher.cxx,v $
*
* $Revision: 1.
2
$
* $Revision: 1.
3
$
*
* last change: $Author: as $ $Date: 2002-05-0
2 11:40:25
$
* last change: $Author: as $ $Date: 2002-05-0
3 08:01:00
$
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
...
...
@@ -111,6 +111,9 @@ namespace framework{
// non exported const
//_________________________________________________________________________________________________________________
#define PROTOCOL_VALUE "mailto:"
#define PROTOCOL_LENGTH 7
//_________________________________________________________________________________________________________________
// non exported definitions
//_________________________________________________________________________________________________________________
...
...
@@ -122,16 +125,18 @@ namespace framework{
//_________________________________________________________________________________________________________________
// XInterface, XTypeProvider, XServiceInfo
DEFINE_XINTERFACE_
4
(
MailToDispatcher
,
DEFINE_XINTERFACE_
5
(
MailToDispatcher
,
OWeakObject
,
DIRECT_INTERFACE
(
css
::
lang
::
XTypeProvider
),
DIRECT_INTERFACE
(
css
::
lang
::
XServiceInfo
),
DIRECT_INTERFACE
(
css
::
frame
::
XDispatchProvider
),
DIRECT_INTERFACE
(
css
::
frame
::
XNotifyingDispatch
),
DIRECT_INTERFACE
(
css
::
frame
::
XDispatch
))
DEFINE_XTYPEPROVIDER_
4
(
MailToDispatcher
,
DEFINE_XTYPEPROVIDER_
5
(
MailToDispatcher
,
css
::
lang
::
XTypeProvider
,
css
::
lang
::
XServiceInfo
,
css
::
frame
::
XDispatchProvider
,
css
::
frame
::
XNotifyingDispatch
,
css
::
frame
::
XDispatch
)
...
...
@@ -185,6 +190,51 @@ MailToDispatcher::~MailToDispatcher()
//_________________________________________________________________________________________________________________
/**
@short decide if this dispatch implementation can be used for requested URL or not
@descr A protocol handler is registerd for an URL pattern inside configuration and will
be asked by the generic dispatch mechanism inside framework, if he can handle this
special URL wich match his registration. He can agree by returning of a valid dispatch
instance or disagree by returning <NULL/>.
We don't create new dispatch instances here realy - we return THIS as result to handle it
at the same implementation.
@modified 02.05.2002 15:25, as96863
*/
css
::
uno
::
Reference
<
css
::
frame
::
XDispatch
>
SAL_CALL
MailToDispatcher
::
queryDispatch
(
const
css
::
util
::
URL
&
aURL
,
const
::
rtl
::
OUString
&
sTarget
,
sal_Int32
nFlags
)
throw
(
css
::
uno
::
RuntimeException
)
{
css
::
uno
::
Reference
<
css
::
frame
::
XDispatch
>
xDispatcher
;
if
(
aURL
.
Complete
.
compareToAscii
(
PROTOCOL_VALUE
,
PROTOCOL_LENGTH
)
==
0
)
xDispatcher
=
this
;
return
xDispatcher
;
}
//_________________________________________________________________________________________________________________
/**
@short do the same like dispatch() but for multiple requests at the same time
@descr -
@modified 02.05.2002 15:27, as96863
*/
css
::
uno
::
Sequence
<
css
::
uno
::
Reference
<
css
::
frame
::
XDispatch
>
>
SAL_CALL
MailToDispatcher
::
queryDispatches
(
const
css
::
uno
::
Sequence
<
css
::
frame
::
DispatchDescriptor
>&
lDescriptor
)
throw
(
css
::
uno
::
RuntimeException
)
{
sal_Int32
nCount
=
lDescriptor
.
getLength
();
css
::
uno
::
Sequence
<
css
::
uno
::
Reference
<
css
::
frame
::
XDispatch
>
>
lDispatcher
(
nCount
);
for
(
sal_Int32
i
=
0
;
i
<
nCount
;
++
i
)
{
lDispatcher
[
i
]
=
this
->
queryDispatch
(
lDescriptor
[
i
].
FeatureURL
,
lDescriptor
[
i
].
FrameName
,
lDescriptor
[
i
].
SearchFlags
);
}
return
lDispatcher
;
}
//_________________________________________________________________________________________________________________
/**
@short dispatch URL with arguments
@descr We use threadsafe internal method to do so. It returns a state value - but we ignore it.
...
...
@@ -272,35 +322,28 @@ sal_Bool MailToDispatcher::implts_dispatch( const css::util::URL&
{
sal_Bool
bSuccess
=
sal_False
;
// don't accept other protocols
// Normaly we shouldn't be used for other URLs then "mailto" ...
// but ...
if
(
aURL
.
Protocol
.
compareToAscii
(
"mailto:"
,
7
)
==
0
)
css
::
uno
::
Reference
<
css
::
lang
::
XMultiServiceFactory
>
xFactory
;
/* SAFE */
{
ReadGuard
aReadLock
(
m_aLock
);
xFactory
=
m_xFactory
;
/* SAFE */
}
css
::
uno
::
Reference
<
css
::
system
::
XSystemShellExecute
>
xSystemShellExecute
(
xFactory
->
createInstance
(
SERVICENAME_SYSTEMSHELLEXECUTE
),
css
::
uno
::
UNO_QUERY
);
if
(
xSystemShellExecute
.
is
())
{
css
::
uno
::
Reference
<
css
::
lang
::
XMultiServiceFactory
>
xFactory
;
/* SAFE */
{
ReadGuard
aReadLock
(
m_aLock
);
xFactory
=
m_xFactory
;
/* SAFE */
}
css
::
uno
::
Reference
<
css
::
system
::
XSystemShellExecute
>
xSystemShellExecute
(
xFactory
->
createInstance
(
SERVICENAME_SYSTEMSHELLEXECUTE
),
css
::
uno
::
UNO_QUERY
);
if
(
xSystemShellExecute
.
is
())
try
{
// start mail client
// Because there is no notofocation about success - we use case of
// no detected exception as SUCCESS - FAILED otherwhise.
xSystemShellExecute
->
execute
(
aURL
.
Complete
,
::
rtl
::
OUString
(),
css
::
system
::
SystemShellExecuteFlags
::
DEFAULTS
);
bSuccess
=
sal_True
;
}
catch
(
css
::
lang
::
IllegalArgumentException
&
)
{
}
catch
(
css
::
system
::
SystemShellExecuteException
&
)
{
try
{
// start mail client
// Because there is no notofocation about success - we use case of
// no detected exception as SUCCESS - FAILED otherwhise.
::
rtl
::
OUString
sURL
(
aURL
.
Complete
);
xSystemShellExecute
->
execute
(
sURL
,
::
rtl
::
OUString
(),
css
::
system
::
SystemShellExecuteFlags
::
DEFAULTS
);
bSuccess
=
sal_True
;
}
catch
(
css
::
lang
::
IllegalArgumentException
&
)
{
}
catch
(
css
::
system
::
SystemShellExecuteException
&
)
{
}
}
}
...
...
framework/source/dispatch/servicehandler.cxx
Dosyayı görüntüle @
484e8767
...
...
@@ -2,9 +2,9 @@
*
* $RCSfile: servicehandler.cxx,v $
*
* $Revision: 1.
1
$
* $Revision: 1.
2
$
*
* last change: $Author: as $ $Date: 2002-05-0
2 11:36:24
$
* last change: $Author: as $ $Date: 2002-05-0
3 08:01:00
$
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
...
...
@@ -103,6 +103,9 @@ namespace framework{
// non exported const
//_________________________________________________________________________________________________________________
#define PROTOCOL_VALUE "service:"
#define PROTOCOL_LENGTH 8
//_________________________________________________________________________________________________________________
// non exported definitions
//_________________________________________________________________________________________________________________
...
...
@@ -114,16 +117,18 @@ namespace framework{
//_________________________________________________________________________________________________________________
// XInterface, XTypeProvider, XServiceInfo
DEFINE_XINTERFACE_
4
(
ServiceHandler
,
DEFINE_XINTERFACE_
5
(
ServiceHandler
,
OWeakObject
,
DIRECT_INTERFACE
(
css
::
lang
::
XTypeProvider
),
DIRECT_INTERFACE
(
css
::
lang
::
XServiceInfo
),
DIRECT_INTERFACE
(
css
::
frame
::
XDispatchProvider
),
DIRECT_INTERFACE
(
css
::
frame
::
XNotifyingDispatch
),
DIRECT_INTERFACE
(
css
::
frame
::
XDispatch
))
DEFINE_XTYPEPROVIDER_
4
(
ServiceHandler
,
DEFINE_XTYPEPROVIDER_
5
(
ServiceHandler
,
css
::
lang
::
XTypeProvider
,
css
::
lang
::
XServiceInfo
,
css
::
frame
::
XDispatchProvider
,
css
::
frame
::
XNotifyingDispatch
,
css
::
frame
::
XDispatch
)
...
...
@@ -177,6 +182,51 @@ ServiceHandler::~ServiceHandler()
//_________________________________________________________________________________________________________________
/**
@short decide if this dispatch implementation can be used for requested URL or not
@descr A protocol handler is registerd for an URL pattern inside configuration and will
be asked by the generic dispatch mechanism inside framework, if he can handle this
special URL wich match his registration. He can agree by returning of a valid dispatch
instance or disagree by returning <NULL/>.
We don't create new dispatch instances here realy - we return THIS as result to handle it
at the same implementation.
@modified 02.05.2002 15:25, as96863
*/
css
::
uno
::
Reference
<
css
::
frame
::
XDispatch
>
SAL_CALL
ServiceHandler
::
queryDispatch
(
const
css
::
util
::
URL
&
aURL
,
const
::
rtl
::
OUString
&
sTarget
,
sal_Int32
nFlags
)
throw
(
css
::
uno
::
RuntimeException
)
{
css
::
uno
::
Reference
<
css
::
frame
::
XDispatch
>
xDispatcher
;
if
(
aURL
.
Complete
.
compareToAscii
(
PROTOCOL_VALUE
,
PROTOCOL_LENGTH
)
==
0
)
xDispatcher
=
this
;
return
xDispatcher
;
}
//_________________________________________________________________________________________________________________
/**
@short do the same like dispatch() but for multiple requests at the same time
@descr -
@modified 02.05.2002 15:27, as96863
*/
css
::
uno
::
Sequence
<
css
::
uno
::
Reference
<
css
::
frame
::
XDispatch
>
>
SAL_CALL
ServiceHandler
::
queryDispatches
(
const
css
::
uno
::
Sequence
<
css
::
frame
::
DispatchDescriptor
>&
lDescriptor
)
throw
(
css
::
uno
::
RuntimeException
)
{
sal_Int32
nCount
=
lDescriptor
.
getLength
();
css
::
uno
::
Sequence
<
css
::
uno
::
Reference
<
css
::
frame
::
XDispatch
>
>
lDispatcher
(
nCount
);
for
(
sal_Int32
i
=
0
;
i
<
nCount
;
++
i
)
{
lDispatcher
[
i
]
=
this
->
queryDispatch
(
lDescriptor
[
i
].
FeatureURL
,
lDescriptor
[
i
].
FrameName
,
lDescriptor
[
i
].
SearchFlags
);
}
return
lDispatcher
;
}
//_________________________________________________________________________________________________________________
/**
@short dispatch URL with arguments
@descr We use threadsafe internal method to do so. It returns a state value - but we ignore it.
...
...
@@ -263,25 +313,19 @@ css::uno::Reference< css::uno::XInterface > ServiceHandler::implts_dispatch( con
{
css
::
uno
::
Reference
<
css
::
uno
::
XInterface
>
xService
;
// don't accept other protocols
// Normaly we shouldn't be used for other URLs then "service:" ...
// but ...
if
(
aURL
.
Complete
.
compareToAscii
(
"service:"
,
8
)
==
0
)
css
::
uno
::
Reference
<
css
::
lang
::
XMultiServiceFactory
>
xFactory
;
/* SAFE */
{
ReadGuard
aReadLock
(
m_aLock
);
xFactory
=
m_xFactory
;
/* SAFE */
}
if
(
xFactory
.
is
())
{
css
::
uno
::
Reference
<
css
::
lang
::
XMultiServiceFactory
>
xFactory
;
/* SAFE */
{
ReadGuard
aReadLock
(
m_aLock
);
xFactory
=
m_xFactory
;
/* SAFE */
}
if
(
xFactory
.
is
())
{
// extract service name from given URL and use it to create the component
// Arguments are not supported yet.
::
rtl
::
OUString
sServiceName
=
aURL
.
Complete
.
copy
(
8
);
if
(
sServiceName
.
getLength
()
>
0
)
xService
=
xFactory
->
createInstance
(
sServiceName
);
}
// extract service name from given URL and use it to create the component
// Arguments are not supported yet.
::
rtl
::
OUString
sServiceName
=
aURL
.
Complete
.
copy
(
PROTOCOL_LENGTH
);
if
(
sServiceName
.
getLength
()
>
0
)
xService
=
xFactory
->
createInstance
(
sServiceName
);
}
return
xService
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment