LibreOffice Module vcl (master)  1
toolkit/fixed.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
11  * Licensed to the Apache Software Foundation (ASF) under one or more
12  * contributor license agreements. See the NOTICE file distributed
13  * with this work for additional information regarding copyright
14  * ownership. The ASF licenses this file to you under the Apache
15  * License, Version 2.0 (the "License"); you may not use this file
16  * except in compliance with the License. You may obtain a copy of
17  * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18  */
19 #pragma once
20 
21 #if !defined(VCL_DLLIMPLEMENTATION) && !defined(TOOLKIT_DLLIMPLEMENTATION) && !defined(VCL_INTERNALS)
22 #error "don't use this in new code"
23 #endif
24 
25 #include <vcl/dllapi.h>
26 #include <vcl/toolkit/edit.hxx>
27 #include <vcl/fixed.hxx>
28 
29 class SelectableFixedText final : public Edit
30 {
31 public:
32  explicit SelectableFixedText( vcl::Window* pParent, WinBits nStyle );
33 
34  virtual void LoseFocus() override;
35  virtual void ApplySettings(vcl::RenderContext&) override;
36 };
37 
38 class VCL_DLLPUBLIC FixedLine final : public Control
39 {
40 private:
42  using Window::ImplInit;
43  SAL_DLLPRIVATE void ImplInit( vcl::Window* pParent, WinBits nStyle );
44  SAL_DLLPRIVATE static WinBits ImplInitStyle( WinBits nStyle );
45  SAL_DLLPRIVATE void ImplDraw(vcl::RenderContext& rRenderContext);
46 
47  virtual void FillLayoutData() const override;
48  virtual const vcl::Font&
49  GetCanonicalFont( const StyleSettings& _rStyle ) const override;
50  virtual const Color&
51  GetCanonicalTextColor( const StyleSettings& _rStyle ) const override;
52 
53 public:
54  explicit FixedLine( vcl::Window* pParent, WinBits nStyle = WB_HORZ );
55 
56  virtual void ApplySettings(vcl::RenderContext&) override;
57 
58  virtual void Paint( vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect ) override;
59  virtual void Draw( OutputDevice* pDev, const Point& rPos, DrawFlags nFlags ) override;
60  virtual void Resize() override;
61  virtual void StateChanged( StateChangedType nType ) override;
62  virtual void DataChanged( const DataChangedEvent& rDCEvt ) override;
63 
64  virtual Size GetOptimalSize() const override;
65 };
66 
67 class VCL_DLLPUBLIC FixedBitmap final : public Control
68 {
69 private:
71 
73  using Window::ImplInit;
74  SAL_DLLPRIVATE void ImplInit( vcl::Window* pParent, WinBits nStyle );
75  SAL_DLLPRIVATE static WinBits ImplInitStyle( WinBits nStyle );
76  SAL_DLLPRIVATE void ImplDraw( OutputDevice* pDev, const Point& rPos, const Size& rSize );
77 
78 public:
79  explicit FixedBitmap( vcl::Window* pParent, WinBits nStyle = 0 );
80 
81  virtual void ApplySettings(vcl::RenderContext&) override;
82 
83  virtual void Paint( vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect ) override;
84  virtual void Draw( OutputDevice* pDev, const Point& rPos, DrawFlags nFlags ) override;
85  virtual void Resize() override;
86  virtual void StateChanged( StateChangedType nType ) override;
87  virtual void DataChanged( const DataChangedEvent& rDCEvt ) override;
88 
89  void SetBitmap( const BitmapEx& rBitmap );
90 };
91 
92 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
#define VCL_DLLPUBLIC
Definition: dllapi.h:29
virtual void StateChanged(StateChangedType nStateChange) override
Definition: ctrl.cxx:260
virtual void FillLayoutData() const
Definition: ctrl.cxx:80
virtual const Color & GetCanonicalTextColor(const StyleSettings &_rStyle) const
Definition: ctrl.cxx:413
virtual void ApplySettings(vcl::RenderContext &rRenderContext) override
Definition: ctrl.cxx:418
StateChangedType
Definition: window.hxx:317
sal_Int64 WinBits
BitmapEx maBitmap
Definition: edit.hxx:55
DrawFlags
Definition: window.hxx:360
Some things multiple-inherit from VclAbstractDialog and OutputDevice, so we need to use virtual inher...
Definition: outdev.hxx:302
virtual void ApplySettings(vcl::RenderContext &) override
Definition: fixed.cxx:446
virtual void Draw(::OutputDevice *pDev, const Point &rPos, DrawFlags nFlags)
Definition: window.cxx:1823
SelectableFixedText(vcl::Window *pParent, WinBits nStyle)
Definition: fixed.cxx:434
SAL_DLLPRIVATE void ImplInit(vcl::Window *pParent, WinBits nStyle, SystemParentData *pSystemParentData)
Definition: window.cxx:935
virtual Size GetOptimalSize() const override
Definition: ctrl.cxx:374
virtual void Resize() override
Definition: ctrl.cxx:74
Definition: ctrl.hxx:33
virtual const vcl::Font & GetCanonicalFont(const StyleSettings &_rStyle) const
Definition: ctrl.cxx:408
virtual void LoseFocus() override
Definition: fixed.cxx:451
QPRO_FUNC_TYPE nType
virtual void Paint(vcl::RenderContext &rRenderContext, const tools::Rectangle &rRect)
Definition: paint.cxx:1019
void ImplInitSettings()
Definition: ctrl.cxx:428
WinBits const WB_HORZ
virtual void DataChanged(const DataChangedEvent &rDCEvt)
Definition: event.cxx:35