Line data Source code
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 : #ifndef INCLUDED_SC_SOURCE_UI_INC_DWFUNCTR_HXX
20 : #define INCLUDED_SC_SOURCE_UI_INC_DWFUNCTR_HXX
21 :
22 : #include <sfx2/childwin.hxx>
23 : #include <sfx2/dockwin.hxx>
24 : #include <svl/lstner.hxx>
25 : #include <svtools/stdctrl.hxx>
26 :
27 : #include <vcl/lstbox.hxx>
28 : #include <vcl/button.hxx>
29 : #include <vcl/combobox.hxx>
30 : #include "anyrefdg.hxx"
31 : #include "global.hxx"
32 : #include "privsplt.hxx"
33 : #include "funcdesc.hxx"
34 :
35 : /** Derivation of SfxChildWindow as "containers" for Controller */
36 0 : class ScFunctionChildWindow : public SfxChildWindow
37 : {
38 : public:
39 : ScFunctionChildWindow( vcl::Window*, sal_uInt16, SfxBindings*,
40 : SfxChildWinInfo* );
41 :
42 : SFX_DECL_CHILDWINDOW_WITHID(ScFunctionChildWindow);
43 : };
44 :
45 : class ScFunctionDockWin : public SfxDockingWindow, public SfxListener
46 : {
47 :
48 : private:
49 : Idle aIdle;
50 : VclPtr<ScPrivatSplit> aPrivatSplit;
51 : VclPtr<ListBox> aCatBox;
52 : VclPtr<ListBox> aFuncList;
53 : VclPtr<ListBox> aDDFuncList;
54 : VclPtr<ListBox> pAllFuncList;
55 :
56 : SfxChildAlignment eSfxNewAlignment;
57 : SfxChildAlignment eSfxOldAlignment;
58 : VclPtr<ImageButton> aInsertButton;
59 : VclPtr<FixedText> aFiFuncDesc;
60 : sal_uLong nMinWidth;
61 : sal_uLong nMinHeight;
62 : Size aOldSize;
63 : bool bSizeFlag;
64 : bool bInit;
65 : short nDockMode;
66 : Point aSplitterInitPos;
67 : const ScFuncDesc* pFuncDesc;
68 : sal_uInt16 nArgs;
69 :
70 : ::std::vector< const formula::IFunctionDescription*> aLRUList;
71 :
72 : void UpdateFunctionList();
73 : void UpdateLRUList();
74 : void DoEnter();
75 : void SetDescription();
76 : void SetLeftRightSize();
77 : void SetTopBottonSize();
78 : void SetMyWidthLeRi(Size &aNewSize);
79 : void SetMyHeightLeRi(Size &aNewSize);
80 : void SetMyWidthToBo(Size &aNewSize);
81 : void SetMyHeightToBo(Size &aNewSize);
82 : void UseSplitterInitPos();
83 :
84 : DECL_LINK( SetSelectionHdl, void* );
85 : DECL_LINK( SelHdl, ListBox* );
86 : DECL_LINK(SetSplitHdl,ScPrivatSplit*);
87 : DECL_LINK_TYPED( TimerHdl, Idle*, void );
88 :
89 : protected:
90 :
91 : virtual bool Close() SAL_OVERRIDE;
92 : virtual void Resize() SAL_OVERRIDE;
93 : virtual void Resizing( Size& rSize ) SAL_OVERRIDE;
94 : void SetSize();
95 : virtual void ToggleFloatingMode() SAL_OVERRIDE;
96 : virtual void StateChanged( StateChangedType nStateChange ) SAL_OVERRIDE;
97 :
98 : virtual SfxChildAlignment CheckAlignment(SfxChildAlignment,
99 : SfxChildAlignment eAlign) SAL_OVERRIDE;
100 :
101 : public:
102 : ScFunctionDockWin( SfxBindings* pBindings,
103 : SfxChildWindow *pCW,
104 : vcl::Window* pParent,
105 : const ResId& rResId );
106 :
107 : virtual ~ScFunctionDockWin();
108 : virtual void dispose() SAL_OVERRIDE;
109 :
110 : using SfxDockingWindow::Notify;
111 : virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) SAL_OVERRIDE;
112 :
113 : void InitLRUList();
114 :
115 : void Initialize (SfxChildWinInfo* pInfo);
116 : virtual void FillInfo(SfxChildWinInfo&) const SAL_OVERRIDE;
117 : };
118 :
119 : #endif
120 :
121 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|