summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2015-05-27 13:47:57 +0200
committerNoel Grandin <noel@peralex.com>2015-05-28 12:47:05 +0200
commit4c93c30c79ae885d488a8a04d383fe5308a1d520 (patch)
treec0309401c718c0459dd1a0035bcbddd113d655b8 /include
parent46a985feca255abbebf826be6103ee8cc7f2cde1 (diff)
convert GETFOCUS constants to scoped enum
Change-Id: I7c324bb6358be28c119592850eb7607479279f09
Diffstat (limited to 'include')
-rw-r--r--include/svtools/editbrowsebox.hxx2
-rw-r--r--include/vcl/button.hxx2
-rw-r--r--include/vcl/window.hxx37
3 files changed, 25 insertions, 16 deletions
diff --git a/include/svtools/editbrowsebox.hxx b/include/svtools/editbrowsebox.hxx
index 2e4bac86f2ee..27c249549251 100644
--- a/include/svtools/editbrowsebox.hxx
+++ b/include/svtools/editbrowsebox.hxx
@@ -667,7 +667,7 @@ namespace svt
sal_uInt16 nColumnId ) const SAL_OVERRIDE;
using Control::ImplInitSettings;
SVT_DLLPRIVATE void ImplInitSettings( bool bFont, bool bForeground, bool bBackground );
- SVT_DLLPRIVATE void DetermineFocus( const sal_uInt16 _nGetFocusFlags = 0);
+ SVT_DLLPRIVATE void DetermineFocus( const GetFocusFlags _nGetFocusFlags = GetFocusFlags::NONE);
static inline void HideAndDisable(CellControllerRef& rController);
inline void EnableAndShow() const;
diff --git a/include/vcl/button.hxx b/include/vcl/button.hxx
index 183b2b1ba6b2..b34ed2e0668e 100644
--- a/include/vcl/button.hxx
+++ b/include/vcl/button.hxx
@@ -317,7 +317,7 @@ protected:
SAL_DLLPRIVATE void ImplLoadRes( const ResId& rResId );
public:
- SAL_DLLPRIVATE void ImplCallClick( bool bGrabFocus = false, sal_uInt16 nFocusFlags = 0 );
+ SAL_DLLPRIVATE void ImplCallClick( bool bGrabFocus = false, GetFocusFlags nFocusFlags = GetFocusFlags::NONE );
SAL_DLLPRIVATE void ImplSetMinimumNWFSize();
protected:
diff --git a/include/vcl/window.hxx b/include/vcl/window.hxx
index 8caf63f1c390..c3be2c647e6a 100644
--- a/include/vcl/window.hxx
+++ b/include/vcl/window.hxx
@@ -325,16 +325,25 @@ enum class StateChangedType : sal_uInt16
};
// GetFocusFlags
-#define GETFOCUS_TAB ((sal_uInt16)0x0001)
-#define GETFOCUS_CURSOR ((sal_uInt16)0x0002)
-#define GETFOCUS_MNEMONIC ((sal_uInt16)0x0004)
-#define GETFOCUS_F6 ((sal_uInt16)0x0008)
-#define GETFOCUS_FORWARD ((sal_uInt16)0x0010)
-#define GETFOCUS_BACKWARD ((sal_uInt16)0x0020)
-#define GETFOCUS_AROUND ((sal_uInt16)0x0040)
-#define GETFOCUS_UNIQUEMNEMONIC ((sal_uInt16)0x0100)
-#define GETFOCUS_INIT ((sal_uInt16)0x0200)
-#define GETFOCUS_FLOATWIN_POPUPMODEEND_CANCEL ((sal_uInt16)0x0400)
+// must match constants in css:awt::FocusChangeReason
+enum class GetFocusFlags
+{
+ NONE = 0x0000,
+ Tab = 0x0001,
+ Cursor = 0x0002,
+ Mnemonic = 0x0004,
+ F6 = 0x0008,
+ Forward = 0x0010,
+ Backward = 0x0020,
+ Around = 0x0040,
+ UniqueMnemonic = 0x0100,
+ Init = 0x0200,
+ FloatWinPopupModeEndCancel = 0x0400,
+};
+namespace o3tl
+{
+ template<> struct typed_flags<GetFocusFlags> : is_typed_flags<GetFocusFlags, 0x077f> {};
+}
// Flags for Draw()
@@ -563,8 +572,8 @@ public:
SAL_DLLPRIVATE Point ImplFrameToOutput( const Point& rPos );
- SAL_DLLPRIVATE void ImplGrabFocus( sal_uInt16 nFlags );
- SAL_DLLPRIVATE void ImplGrabFocusToDocument( sal_uInt16 nFlags );
+ SAL_DLLPRIVATE void ImplGrabFocus( GetFocusFlags nFlags );
+ SAL_DLLPRIVATE void ImplGrabFocusToDocument( GetFocusFlags nFlags );
SAL_DLLPRIVATE void ImplInvertFocus( const Rectangle& rRect );
SAL_DLLPRIVATE PointerStyle ImplGetMousePointer() const;
@@ -578,7 +587,7 @@ public:
SAL_DLLPRIVATE void ImplDeleteOverlapBackground();
- SAL_DLLPRIVATE void ImplControlFocus( sal_uInt16 nFlags = 0 );
+ SAL_DLLPRIVATE void ImplControlFocus( GetFocusFlags nFlags = GetFocusFlags::NONE );
SAL_DLLPRIVATE void ImplMirrorFramePos( Point &pt ) const;
@@ -1134,7 +1143,7 @@ public:
bool HasChildPathFocus( bool bSystemWindow = false ) const;
bool IsActive() const;
bool HasActiveChildFrame();
- sal_uInt16 GetGetFocusFlags() const;
+ GetFocusFlags GetGetFocusFlags() const;
void GrabFocusToDocument();
/**