summaryrefslogtreecommitdiff
path: root/include/ucbhelper
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2016-09-23 13:42:44 +0200
committerNoel Grandin <noel@peralex.com>2016-09-26 08:29:38 +0200
commit7f97b5e72c61066ea1ddd0f782e50070ce5f6363 (patch)
tree410d4ff48adff9a3ec535e96efe8240d660f0a05 /include/ucbhelper
parent69c29c9f895fa58c923af5e6dee1226f8bbfeceb (diff)
convert CONTINUATION constants to typed_flags_set
Change-Id: I38333e5d229aa520fbe0a8ad72007c503853956e
Diffstat (limited to 'include/ucbhelper')
-rw-r--r--include/ucbhelper/simpleinteractionrequest.hxx39
1 files changed, 21 insertions, 18 deletions
diff --git a/include/ucbhelper/simpleinteractionrequest.hxx b/include/ucbhelper/simpleinteractionrequest.hxx
index 9ffa8475275e..64b892ae801d 100644
--- a/include/ucbhelper/simpleinteractionrequest.hxx
+++ b/include/ucbhelper/simpleinteractionrequest.hxx
@@ -22,28 +22,31 @@
#include <ucbhelper/interactionrequest.hxx>
#include <ucbhelper/ucbhelperdllapi.h>
-
-namespace ucbhelper {
+#include <o3tl/typed_flags_set.hxx>
/** These are the constants that can be passed to the constructor of class
* SimpleInteractionRequest and that are returned by method
* SimpleInteractionRequest::getResponse().
*/
-/** The request was not (yet) handled by the interaction handler. */
-static const sal_Int32 CONTINUATION_UNKNOWN = 0;
-
-/** The interaction handler selected XInteractionAbort. */
-static const sal_Int32 CONTINUATION_ABORT = 1;
-
-/** The interaction handler selected XInteractionRetry. */
-static const sal_Int32 CONTINUATION_RETRY = 2;
-
-/** The interaction handler selected XInteractionApprove. */
-static const sal_Int32 CONTINUATION_APPROVE = 4;
+enum class ContinuationFlags {
+ /** The request was not (yet) handled by the interaction handler. */
+ NONE = 0,
+ /** The interaction handler selected XInteractionAbort. */
+ Abort = 1,
+ /** The interaction handler selected XInteractionRetry. */
+ Retry = 2,
+ /** The interaction handler selected XInteractionApprove. */
+ Approve = 4,
+ /** The interaction handler selected XInteractionDisapprove. */
+ Disapprove = 8,
+};
+namespace o3tl
+{
+ template<> struct typed_flags<ContinuationFlags> : is_typed_flags<ContinuationFlags, 0x0f> {};
+}
-/** The interaction handler selected XInteractionDisapprove. */
-static const sal_Int32 CONTINUATION_DISAPPROVE = 8;
+namespace ucbhelper {
/**
* This class implements a simple interaction request. The user must not deal
@@ -71,16 +74,16 @@ public:
* listed above.
*/
SimpleInteractionRequest( const css::uno::Any & rRequest,
- const sal_Int32 nContinuations );
+ const ContinuationFlags nContinuations );
/**
* After passing this request to XInteractionHandler::handle, this method
* returns the continuation that was chosen by the interaction handler.
*
* @return the continuation chosen by an interaction handler or
- * CONTINUATION_UNKNOWN, if the request was not (yet) handled.
+ * ContinuationFlags::NONE, if the request was not (yet) handled.
*/
- sal_Int32 getResponse() const;
+ ContinuationFlags getResponse() const;
};
} // namespace ucbhelper