summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2011-11-03 17:45:47 +0100
committerStephan Bergmann <sbergman@redhat.com>2011-11-04 08:21:26 +0100
commite66e54fb00bf74d13b7059bd32b6207a029afa5e (patch)
tree05a1a0e9c5cf4c889537cd3e616598effa0a85c1 /vcl
parente04249337551653f63ba9b2a2302578961e38562 (diff)
Further clean up of areas touched by previous commit.
Diffstat (limited to 'vcl')
-rw-r--r--vcl/aqua/source/app/vclnsapp.mm10
-rw-r--r--vcl/aqua/source/window/salmenu.cxx2
-rw-r--r--vcl/inc/vcl/svapp.hxx35
-rw-r--r--vcl/ios/source/app/vcluiapp.mm2
4 files changed, 20 insertions, 29 deletions
diff --git a/vcl/aqua/source/app/vclnsapp.mm b/vcl/aqua/source/app/vclnsapp.mm
index e2da47c8bc5b..e2f500d396ba 100644
--- a/vcl/aqua/source/app/vclnsapp.mm
+++ b/vcl/aqua/source/app/vclnsapp.mm
@@ -314,7 +314,7 @@
const rtl::OUString aFile( GetOUString( pFile ) );
if( ! AquaSalInstance::isOnCommandLine( aFile ) )
{
- const ApplicationEvent* pAppEvent = new ApplicationEvent(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(APPEVENT_OPEN_STRING)), aFile);
+ const ApplicationEvent* pAppEvent = new ApplicationEvent(ApplicationEvent::TYPE_OPEN, aFile);
AquaSalInstance::aAppEventList.push_back( pAppEvent );
}
return YES;
@@ -344,7 +344,7 @@
// we have no back channel here, we have to assume success, in which case
// replyToOpenOrPrint does not need to be called according to documentation
// [app replyToOpenOrPrint: NSApplicationDelegateReplySuccess];
- const ApplicationEvent* pAppEvent = new ApplicationEvent(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(APPEVENT_OPEN_STRING)), aFileList.makeStringAndClear());
+ const ApplicationEvent* pAppEvent = new ApplicationEvent(ApplicationEvent::TYPE_OPEN, aFileList.makeStringAndClear());
AquaSalInstance::aAppEventList.push_back( pAppEvent );
}
}
@@ -353,7 +353,7 @@
{
(void)app;
const rtl::OUString aFile( GetOUString( pFile ) );
- const ApplicationEvent* pAppEvent = new ApplicationEvent(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(APPEVENT_PRINT_STRING)), aFile);
+ const ApplicationEvent* pAppEvent = new ApplicationEvent(ApplicationEvent::TYPE_PRINT, aFile);
AquaSalInstance::aAppEventList.push_back( pAppEvent );
return YES;
}
@@ -374,7 +374,7 @@
aFileList.append('\n');
aFileList.append( GetOUString( pFile ) );
}
- const ApplicationEvent* pAppEvent = new ApplicationEvent(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(APPEVENT_PRINT_STRING)), aFileList.makeStringAndClear());
+ const ApplicationEvent* pAppEvent = new ApplicationEvent(ApplicationEvent::TYPE_PRINT, aFileList.makeStringAndClear());
AquaSalInstance::aAppEventList.push_back( pAppEvent );
// we have no back channel here, we have to assume success
// correct handling would be NSPrintingReplyLater and then send [app replyToOpenOrPrint]
@@ -398,7 +398,7 @@
if( aReply == NSTerminateNow )
{
- ApplicationEvent aEv(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("PRIVATE:DOSHUTDOWN")));
+ ApplicationEvent aEv(ApplicationEvent::TYPE_PRIVATE_DOSHUTDOWN);
GetpApp()->AppEvent( aEv );
ImplImageTreeSingletonRef()->shutDown();
// DeInitVCL should be called in ImplSVMain - unless someon _exits first which
diff --git a/vcl/aqua/source/window/salmenu.cxx b/vcl/aqua/source/window/salmenu.cxx
index 50aa9a673ed5..509ef731ab75 100644
--- a/vcl/aqua/source/window/salmenu.cxx
+++ b/vcl/aqua/source/window/salmenu.cxx
@@ -75,7 +75,7 @@ const AquaSalMenu* AquaSalMenu::pCurrentMenuBar = NULL;
else if( nDialog == SHOWDIALOG_ID_PREFERENCES )
aDialog = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("PREFERENCES"));
const ApplicationEvent* pAppEvent = new ApplicationEvent(
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SHOWDIALOG")), aDialog);
+ ApplicationEvent::TYPE_SHOWDIALOG, aDialog);
AquaSalInstance::aAppEventList.push_back( pAppEvent );
}
}
diff --git a/vcl/inc/vcl/svapp.hxx b/vcl/inc/vcl/svapp.hxx
index fb32a8ba245c..ccd232ca5997 100644
--- a/vcl/inc/vcl/svapp.hxx
+++ b/vcl/inc/vcl/svapp.hxx
@@ -97,36 +97,27 @@ typedef long (*VCLEventHookProc)( NotifyEvent& rEvt, void* pData );
enum Service { SERVICE_OLE, SERVICE_APPEVENT, SERVICE_IPC };
#endif
-#define APPEVENT_OPEN_STRING "Open"
-#define APPEVENT_PRINT_STRING "Print"
-
class VCL_DLLPUBLIC ApplicationEvent
{
- rtl::OUString aEvent;
- rtl::OUString aData;
- std::vector<rtl::OUString> aParams;
-
- ApplicationEvent();
public:
- ApplicationEvent(const rtl::OUString& rEvent,
+ enum Type {
+ TYPE_ACCEPT, TYPE_APPEAR, TYPE_HELP, TYPE_OPEN, TYPE_OPENHELPURL,
+ TYPE_PRINT, TYPE_PRIVATE_DOSHUTDOWN, TYPE_QUICKSTART, TYPE_SHOWDIALOG,
+ TYPE_UNACCEPT
+ };
+
+ ApplicationEvent(Type rEvent,
const rtl::OUString& rData = rtl::OUString()):
aEvent(rEvent),
aData(rData)
- {
- sal_Int32 start = 0;
- for(sal_Int32 i = 0; i < rData.getLength(); ++i)
- {
- if(rData[i] == '\n')
- {
- aParams.push_back(rData.copy(start, i - start));
- start = ++i;
- }
- }
- }
+ {}
- const rtl::OUString& GetEvent() const { return aEvent; }
+ Type GetEvent() const { return aEvent; }
const rtl::OUString& GetData() const { return aData; }
- const std::vector<rtl::OUString>& GetParams() const { return aParams; }
+
+private:
+ Type aEvent;
+ rtl::OUString aData;
};
class VCL_DLLPUBLIC PropertyHandler
diff --git a/vcl/ios/source/app/vcluiapp.mm b/vcl/ios/source/app/vcluiapp.mm
index c47669e69138..600cae8d2322 100644
--- a/vcl/ios/source/app/vcluiapp.mm
+++ b/vcl/ios/source/app/vcluiapp.mm
@@ -79,7 +79,7 @@
// we have no back channel here, we have to assume success, in which case
// replyToOpenOrPrint does not need to be called according to documentation
// [app replyToOpenOrPrint: NSApplicationDelegateReplySuccess];
- const ApplicationEvent* pAppEvent = new ApplicationEvent(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(APPEVENT_OPEN_STRING)), aFileList.makeStringAndClear());
+ const ApplicationEvent* pAppEvent = new ApplicationEvent(ApplicationEvent::TYPE_OPEN, aFileList.makeStringAndClear());
IosSalInstance::aAppEventList.push_back( pAppEvent );
}
}