summaryrefslogtreecommitdiff
path: root/framework/inc/protocols.h
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-02-06 09:15:51 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-02-06 07:57:28 +0000
commitbac9a5d634b333fdc2345bfd3fa852ccc5f0d73b (patch)
tree004b3ad26f5bf29bde28570d8370336377d7402a /framework/inc/protocols.h
parentfcb0280c1023102a08c4efea43bcf08f005fa499 (diff)
loplugin:unusedenumconstants in framework
Convert EProtocol to scoped enum and drop E_UNKNOWN_PROTOCOL. Convert ToggleButtonToolbarController::Style to scoped enum and drop STYLE_TOGGLEBUTTON. Convert TargetHelper::ESpecialTarget to scoped enum and drop E_NOT_SPECIAL. Change-Id: I412adacac15192cf6563ce4d5e5b74bfffff4737 Reviewed-on: https://gerrit.libreoffice.org/33949 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'framework/inc/protocols.h')
-rw-r--r--framework/inc/protocols.h53
1 files changed, 25 insertions, 28 deletions
diff --git a/framework/inc/protocols.h b/framework/inc/protocols.h
index b93f292e0f15..4e7f1cb9d0c0 100644
--- a/framework/inc/protocols.h
+++ b/framework/inc/protocols.h
@@ -53,29 +53,26 @@ namespace framework{
// for sending news
#define SPECIALPROTOCOL_NEWS "news:"
+/** well known protocols */
+enum class EProtocol
+{
+ Private,
+ PrivateObject,
+ PrivateStream,
+ PrivateFactory,
+ Slot,
+ Uno,
+ Macro,
+ Service,
+ MailTo,
+ News
+};
+
class ProtocolCheck
{
public:
/**
- enums for well known protocols
- */
- enum EProtocol
- {
- E_UNKNOWN_PROTOCOL ,
- E_PRIVATE ,
- E_PRIVATE_OBJECT ,
- E_PRIVATE_STREAM ,
- E_PRIVATE_FACTORY ,
- E_SLOT ,
- E_UNO ,
- E_MACRO ,
- E_SERVICE ,
- E_MAILTO ,
- E_NEWS
- };
-
- /**
it checks if given URL match the required protocol only
It should be used instead of specifyProtocol() if only this question
is interesting to perform the code. We must not check for all possible protocols here...
@@ -85,34 +82,34 @@ class ProtocolCheck
bool bRet = false;
switch(eRequired)
{
- case E_PRIVATE:
+ case EProtocol::Private:
bRet = sURL.startsWith(SPECIALPROTOCOL_PRIVATE);
break;
- case E_PRIVATE_OBJECT:
+ case EProtocol::PrivateObject:
bRet = sURL.startsWith(SPECIALPROTOCOL_PRIVATE_OBJECT);
break;
- case E_PRIVATE_STREAM:
+ case EProtocol::PrivateStream:
bRet = sURL.startsWith(SPECIALPROTOCOL_PRIVATE_STREAM);
break;
- case E_PRIVATE_FACTORY:
+ case EProtocol::PrivateFactory:
bRet = sURL.startsWith(SPECIALPROTOCOL_PRIVATE_FACTORY);
break;
- case E_SLOT:
+ case EProtocol::Slot:
bRet = sURL.startsWith(SPECIALPROTOCOL_SLOT);
break;
- case E_UNO:
+ case EProtocol::Uno:
bRet = sURL.startsWith(SPECIALPROTOCOL_UNO);
break;
- case E_MACRO:
+ case EProtocol::Macro:
bRet = sURL.startsWith(SPECIALPROTOCOL_MACRO);
break;
- case E_SERVICE:
+ case EProtocol::Service:
bRet = sURL.startsWith(SPECIALPROTOCOL_SERVICE);
break;
- case E_MAILTO:
+ case EProtocol::MailTo:
bRet = sURL.startsWith(SPECIALPROTOCOL_MAILTO);
break;
- case E_NEWS:
+ case EProtocol::News:
bRet = sURL.startsWith(SPECIALPROTOCOL_NEWS);
break;
default: