update dev300-m58
[ooovba.git] / sc / source / ui / inc / dwfunctr.hxx
blob41e6d03482d111fd62718ee85dc327c99b9157a4
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: dwfunctr.hxx,v $
10 * $Revision: 1.7.46.1 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef _SC_DWFUNCTR_HXX
31 #define _SC_DWFUNCTR_HXX
33 #include <sfx2/childwin.hxx>
34 #include <sfx2/dockwin.hxx>
35 #include <svtools/lstner.hxx>
36 #include <svtools/stdctrl.hxx>
38 #ifndef _LSTBOX_HXX //autogen
39 #include <vcl/lstbox.hxx>
40 #endif
42 #ifndef _IMAGEBTN_HXX //autogen
43 #include <vcl/imagebtn.hxx>
44 #endif
46 #ifndef _COMBOBOX_HXX //autogen
47 #include <vcl/combobox.hxx>
48 #endif
49 #include "anyrefdg.hxx"
50 #include "global.hxx" // ScAddress
51 #include "privsplt.hxx"
52 #include "funcdesc.hxx"
54 #ifndef LRU_MAX
55 #define LRU_MAX 10
56 #endif
57 /*************************************************************************
59 |* Ableitung vom SfxChildWindow als "Behaelter" fuer Controller
61 \************************************************************************/
63 class ScFunctionChildWindow : public SfxChildWindow
65 public:
66 ScFunctionChildWindow( Window*, USHORT, SfxBindings*,
67 SfxChildWinInfo* );
69 SFX_DECL_CHILDWINDOW(ScFunctionChildWindow);
72 /*************************************************************************
74 |* ScFuncDockWin
76 \************************************************************************/
78 class ScFunctionDockWin : public SfxDockingWindow, public SfxListener
81 private:
82 Timer aTimer;
83 ScPrivatSplit aPrivatSplit;
84 ListBox aCatBox;
85 ListBox aFuncList;
86 ListBox aDDFuncList;
87 ListBox* pAllFuncList;
89 SfxChildAlignment eSfxNewAlignment;
90 SfxChildAlignment eSfxOldAlignment;
91 ImageButton aInsertButton;
92 FixedText aFiFuncDesc;
93 USHORT nLeftSlot;
94 USHORT nRightSlot;
95 ULONG nMinWidth;
96 ULONG nMinHeight;
97 Size aOldSize;
98 BOOL bSizeFlag;
99 BOOL bInit;
100 short nDockMode;
101 Point aSplitterInitPos;
102 const ScFuncDesc* pFuncDesc;
103 USHORT nArgs;
104 String** pArgArr;
107 const ScFuncDesc* aLRUList[LRU_MAX];
109 void UpdateFunctionList();
110 void UpdateLRUList();
111 void DoEnter(BOOL bOk); //@@ ???
112 void SetDescription();
113 void SetLeftRightSize();
114 void SetTopBottonSize();
115 void SetMyWidthLeRi(Size &aNewSize);
116 void SetMyHeightLeRi(Size &aNewSize);
117 void SetMyWidthToBo(Size &aNewSize);
118 void SetMyHeightToBo(Size &aNewSize);
119 void UseSplitterInitPos();
121 DECL_LINK( SetSelectionHdl, void* );
122 DECL_LINK( SelHdl, ListBox* );
123 DECL_LINK(SetSplitHdl,ScPrivatSplit*);
124 DECL_LINK( TimerHdl, Timer*);
126 protected:
128 virtual BOOL Close();
129 virtual void Resize();
130 virtual void Resizing( Size& rSize );
131 virtual void SetSize();
132 virtual void ToggleFloatingMode();
133 virtual void StateChanged( StateChangedType nStateChange );
136 virtual SfxChildAlignment CheckAlignment(SfxChildAlignment,
137 SfxChildAlignment eAlign);
139 public:
140 ScFunctionDockWin( SfxBindings* pBindings,
141 SfxChildWindow *pCW,
142 Window* pParent,
143 const ResId& rResId );
145 ~ScFunctionDockWin();
147 using SfxDockingWindow::Notify;
148 virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
150 void SetSlotIDs( USHORT nLeft, USHORT nRight )
151 { nLeftSlot = nLeft; nRightSlot = nRight; }
153 void InitLRUList();
155 void Initialize (SfxChildWinInfo* pInfo);
156 virtual void FillInfo(SfxChildWinInfo&) const;
159 #endif