summaryrefslogtreecommitdiff
path: root/vcl/inc/vcl/ctrl.hxx
diff options
context:
space:
mode:
Diffstat (limited to 'vcl/inc/vcl/ctrl.hxx')
-rw-r--r--vcl/inc/vcl/ctrl.hxx52
1 files changed, 47 insertions, 5 deletions
diff --git a/vcl/inc/vcl/ctrl.hxx b/vcl/inc/vcl/ctrl.hxx
index 7bb5620ef93f..535f75549991 100644
--- a/vcl/inc/vcl/ctrl.hxx
+++ b/vcl/inc/vcl/ctrl.hxx
@@ -38,7 +38,7 @@
#include <vcl/salnativewidgets.hxx>
// forward
-namespace vcl { struct ControlLayoutData; }
+namespace vcl { struct ImplControlData; struct ControlLayoutData; }
// -----------
// - Control -
@@ -47,11 +47,12 @@ namespace vcl { struct ControlLayoutData; }
class VCL_DLLPUBLIC Control : public Window
{
protected:
- mutable vcl::ControlLayoutData* mpLayoutData;
+ ::vcl::ImplControlData* mpControlData;
+
private:
- BOOL mbHasFocus;
- Link maGetFocusHdl;
- Link maLoseFocusHdl;
+ BOOL mbHasFocus;
+ Link maGetFocusHdl;
+ Link maLoseFocusHdl;
SAL_DLLPRIVATE void ImplInitControlData();
@@ -66,6 +67,14 @@ protected:
// helper method for composite controls
void AppendLayoutData( const Control& rSubControl ) const;
+ /// creates the mpData->mpLayoutData structure
+ void CreateLayoutData() const;
+ /// determines whether we currently have layout data
+ bool HasLayoutData() const;
+ /// returns the current layout data
+ ::vcl::ControlLayoutData*
+ GetLayoutData() const;
+
/** this calls both our event listeners, and a specified handler
If the Control instance is destroyed during any of those calls, the
@@ -84,6 +93,25 @@ protected:
ULONG nEvent, const Link& rHandler, void* pCaller
);
+ /** draws the given text onto the given device
+
+ If no reference device is set, the draw request will simply be forwarded to OutputDevice::DrawText. Otherwise,
+ the text will be rendered according to the metrics at the reference device.
+
+ Note that the given rectangle might be modified, it will contain the result of a GetTextRect call (either
+ directly at the target device, or taking the reference device into account) when returning.
+ */
+ void DrawControlText( OutputDevice& _rTargetDevice, Rectangle& _io_rRect,
+ const XubString& _rStr, USHORT _nStyle,
+ MetricVector* _pVector, String* _pDisplayText ) const;
+
+ virtual const Font&
+ GetCanonicalFont( const StyleSettings& _rStyle ) const;
+ virtual const Color&
+ GetCanonicalTextColor( const StyleSettings& _rStyle ) const;
+
+ void ImplInitSettings( const BOOL _bFont, const BOOL _bForeground );
+
//#if 0 // _SOLAR__PRIVATE
public:
SAL_DLLPRIVATE void ImplClearLayoutData() const;
@@ -157,6 +185,20 @@ public:
void SetLayoutDataParent( const Control* pParent ) const;
virtual Size GetOptimalSize(WindowSizeType eType) const;
+
+ /** sets a reference device used for rendering control text
+ @seealso DrawControlText
+ */
+ void SetReferenceDevice( OutputDevice* _referenceDevice );
+ OutputDevice* GetReferenceDevice() const;
+
+ Font GetUnzoomedControlPointFont() const
+ {
+ Font aFont( GetCanonicalFont( GetSettings().GetStyleSettings() ) );
+ if ( IsControlFont() )
+ aFont.Merge( GetControlFont() );
+ return aFont;
+ }
};
#endif // _SV_CTRL_HXX