LibreOffice Module forms (master) 1
navtoolbar.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
20#pragma once
21
23#include <memory>
24
25namespace frm
26{
27 class IFeatureDispatcher;
28 class DocumentCommandImageProvider;
29 class ICommandDescriptionProvider;
30 class ImplNavToolBar;
31 typedef std::shared_ptr< const DocumentCommandImageProvider > PCommandImageProvider;
32
33 class NavigationToolBar final : public vcl::Window
34 {
35 public:
37 {
39 eLarge
40 };
41
43 {
48 };
49
50 private:
52 const std::shared_ptr< const DocumentCommandImageProvider >
56 ::std::vector< VclPtr<vcl::Window> > m_aChildWins;
57 const OUString m_sModuleId;
58
59 public:
61 vcl::Window* _pParent,
62 WinBits _nStyle,
63 PCommandImageProvider _pImageProvider,
64 OUString sModuleId
65 );
66 virtual ~NavigationToolBar( ) override;
67 virtual void dispose() override;
68
79 void setDispatcher( const IFeatureDispatcher* _pDispatcher );
80
82 void enableFeature( sal_Int16 _nFeatureId, bool _bEnabled );
83
85 void checkFeature( sal_Int16 _nFeatureId, bool _bEnabled );
86
88 void setFeatureText( sal_Int16 _nFeatureId, const OUString& _rText );
89
92 ImageSize GetImageSize( ) const { return m_eImageSize; }
93
96 void SetImageSize( ImageSize _eSize );
97
100 void ShowFunctionGroup( FunctionGroup _eGroup, bool _bShow );
101
105
106 // Window "overridables" (hiding the respective Window methods)
108 void SetControlBackground( const Color& rColor );
109 void SetTextLineColor( );
110 void SetTextLineColor( const Color& rColor );
111
112 private:
113 // Window overridables
114 virtual void Resize() override;
115 virtual void StateChanged( StateChangedType nType ) override;
116
118 void implInit( );
119
121 void implSetImageSize( ImageSize _eSize );
122
124 void implUpdateImages();
125
127 void implEnableItem( sal_uInt16 _nItemId, bool _bEnabled );
128
129 // iterating through item windows
130 typedef void (NavigationToolBar::*ItemWindowHandler) (sal_uInt16, vcl::Window*) const;
131 void forEachItemWindow( ItemWindowHandler _handler );
132 typedef void (*ItemWindowHandler2) (sal_uInt16, vcl::Window*, const void*);
133 void forEachItemWindow( ItemWindowHandler2 _handler, const void* _pParam );
134
135 static void setItemBackground( sal_uInt16 /* _nItemId */, vcl::Window* _pItemWindow, const void* _pColor );
136 static void setTextLineColor( sal_uInt16 /* _nItemId */, vcl::Window* _pItemWindow, const void* _pColor );
137#if 0
138 void setItemWindowZoom( sal_uInt16 /* _nItemId */, vcl::Window* _pItemWindow, const void* /* _pParam */ ) const;
139#endif
140 void setItemControlFont( sal_uInt16 /* _nItemId */, vcl::Window* _pItemWindow ) const;
141 void setItemControlForeground( sal_uInt16 /* _nItemId */, vcl::Window* _pItemWindow ) const;
142 void adjustItemWindowWidth( sal_uInt16 _nItemId, vcl::Window* _pItemWindow ) const;
143 static void enableItemRTL( sal_uInt16 /*_nItemId*/, vcl::Window* _pItemWindow, const void* _pIsRTLEnabled );
144 };
145
147 {
148 private:
150
151 public:
152 RecordPositionInput( vcl::Window* _pParent );
153
156 void setDispatcher( const IFeatureDispatcher* _pDispatcher );
157
158 private:
159 virtual void PositionFired(sal_Int64 nRecord) override;
160 };
161
162} // namespace frm
163
164/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
static void setItemBackground(sal_uInt16, vcl::Window *_pItemWindow, const void *_pColor)
Definition: navtoolbar.cxx:548
virtual ~NavigationToolBar() override
Definition: navtoolbar.cxx:149
void implInit()
ctor implementation
Definition: navtoolbar.cxx:232
void setFeatureText(sal_Int16 _nFeatureId, const OUString &_rText)
sets the text of a given feature
Definition: navtoolbar.cxx:215
static void enableItemRTL(sal_uInt16, vcl::Window *_pItemWindow, const void *_pIsRTLEnabled)
Definition: navtoolbar.cxx:616
void adjustItemWindowWidth(sal_uInt16 _nItemId, vcl::Window *_pItemWindow) const
Definition: navtoolbar.cxx:581
void implSetImageSize(ImageSize _eSize)
impl version of SetImageSize
Definition: navtoolbar.cxx:367
void setDispatcher(const IFeatureDispatcher *_pDispatcher)
sets the dispatcher which is to be used for the features
Definition: navtoolbar.cxx:163
const std::shared_ptr< const DocumentCommandImageProvider > m_pImageProvider
Definition: navtoolbar.hxx:53
void enableFeature(sal_Int16 _nFeatureId, bool _bEnabled)
enables or disables a given feature
Definition: navtoolbar.cxx:199
void checkFeature(sal_Int16 _nFeatureId, bool _bEnabled)
checks or unchecks a given feature
Definition: navtoolbar.cxx:207
void ShowFunctionGroup(FunctionGroup _eGroup, bool _bShow)
shows or hides a function group
Definition: navtoolbar.cxx:383
void implUpdateImages()
updates the images of our items
Definition: navtoolbar.cxx:323
ImageSize GetImageSize() const
retrieves the current image size
Definition: navtoolbar.hxx:92
virtual void Resize() override
Definition: navtoolbar.cxx:482
void implEnableItem(sal_uInt16 _nItemId, bool _bEnabled)
enables or disables an item, plus possible dependent items
Definition: navtoolbar.cxx:188
virtual void dispose() override
Definition: navtoolbar.cxx:154
void setItemControlFont(sal_uInt16, vcl::Window *_pItemWindow) const
Definition: navtoolbar.cxx:564
VclPtr< ImplNavToolBar > m_pToolbar
Definition: navtoolbar.hxx:55
void(NavigationToolBar::* ItemWindowHandler)(sal_uInt16, vcl::Window *) const
Definition: navtoolbar.hxx:130
virtual void StateChanged(StateChangedType nType) override
Definition: navtoolbar.cxx:448
void forEachItemWindow(ItemWindowHandler _handler)
Definition: navtoolbar.cxx:526
static void setTextLineColor(sal_uInt16, vcl::Window *_pItemWindow, const void *_pColor)
Definition: navtoolbar.cxx:556
void setItemControlForeground(sal_uInt16, vcl::Window *_pItemWindow) const
Definition: navtoolbar.cxx:572
void SetImageSize(ImageSize _eSize)
sets the size of the images
Definition: navtoolbar.cxx:377
const IFeatureDispatcher * m_pDispatcher
Definition: navtoolbar.hxx:51
bool IsFunctionGroupVisible(FunctionGroup _eGroup)
determines whether or not a given function group is currently visible
Definition: navtoolbar.cxx:431
void(* ItemWindowHandler2)(sal_uInt16, vcl::Window *, const void *)
Definition: navtoolbar.hxx:132
const OUString m_sModuleId
Definition: navtoolbar.hxx:57
::std::vector< VclPtr< vcl::Window > > m_aChildWins
Definition: navtoolbar.hxx:56
NavigationToolBar(vcl::Window *_pParent, WinBits _nStyle, PCommandImageProvider _pImageProvider, OUString sModuleId)
Definition: navtoolbar.cxx:136
const IFeatureDispatcher * m_pDispatcher
Definition: navtoolbar.hxx:149
RecordPositionInput(vcl::Window *_pParent)
Definition: navtoolbar.cxx:621
virtual void PositionFired(sal_Int64 nRecord) override
Definition: navtoolbar.cxx:632
void setDispatcher(const IFeatureDispatcher *_pDispatcher)
sets the dispatcher which is to be used for the features
Definition: navtoolbar.cxx:627
ListBox is a bit confusing / different from other form components, so here are a few notes:
Definition: BaseListBox.hxx:25
std::shared_ptr< const DocumentCommandImageProvider > PCommandImageProvider
StateChangedType
sal_Int64 WinBits