fix baseline build (old cairo) - 'cairo_rectangle_int_t' does not name a type
[LibreOffice.git] / sc / source / ui / inc / navipi.hxx
blobc355813b300e8308d425770ee0b6efa1bb16ebd1
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #ifndef INCLUDED_SC_SOURCE_UI_INC_NAVIPI_HXX
21 #define INCLUDED_SC_SOURCE_UI_INC_NAVIPI_HXX
23 #include <vector>
24 #include <vcl/toolbox.hxx>
25 #include <vcl/field.hxx>
26 #include <vcl/lstbox.hxx>
27 #include <vcl/idle.hxx>
28 #include <svtools/stdctrl.hxx>
29 #include <svl/poolitem.hxx>
30 #include <svl/lstner.hxx>
31 #include <sfx2/childwin.hxx>
32 #include "content.hxx"
33 #include <svtools/svmedit.hxx>
35 class ScTabViewShell;
36 class ScViewData;
37 class ScArea;
38 class ScScenarioWindow;
39 class ScNavigatorControllerItem;
40 class ScNavigatorDialogWrapper;
41 class ScNavigatorDlg;
42 class ScNavigatorSettings;
44 #define SC_DROPMODE_URL 0
45 #define SC_DROPMODE_LINK 1
46 #define SC_DROPMODE_COPY 2
48 enum NavListMode { NAV_LMODE_NONE = 0x4000,
49 NAV_LMODE_AREAS = 0x2000,
50 NAV_LMODE_DBAREAS = 0x1000,
51 NAV_LMODE_DOCS = 0x800,
52 NAV_LMODE_SCENARIOS = 0x400 };
54 // class ScScenarioListBox -----------------------------------------------
56 class ScScenarioListBox : public ListBox
58 public:
59 explicit ScScenarioListBox( ScScenarioWindow& rParent );
60 virtual ~ScScenarioListBox();
62 void UpdateEntries( const std::vector<OUString> &aNewEntryList );
64 protected:
65 virtual void Select() SAL_OVERRIDE;
66 virtual void DoubleClick() SAL_OVERRIDE;
67 virtual bool Notify( NotifyEvent& rNEvt ) SAL_OVERRIDE;
69 private:
70 struct ScenarioEntry
72 OUString maName;
73 OUString maComment;
74 bool mbProtected;
76 inline explicit ScenarioEntry() : mbProtected( false ) {}
78 typedef ::std::vector< ScenarioEntry > ScenarioList;
80 private:
81 const ScenarioEntry* GetSelectedEntry() const;
83 void ExecuteScenarioSlot( sal_uInt16 nSlotId );
84 void SelectScenario();
85 void EditScenario();
86 void DeleteScenario( bool bQueryBox );
88 private:
89 ScScenarioWindow& mrParent;
90 ScenarioList maEntries;
93 // class ScScenarioWindow ------------------------------------------------
95 class ScScenarioWindow : public vcl::Window
97 public:
98 ScScenarioWindow( vcl::Window* pParent, const OUString& aQH_List, const OUString& aQH_Comment);
99 virtual ~ScScenarioWindow();
100 virtual void dispose() SAL_OVERRIDE;
102 void NotifyState( const SfxPoolItem* pState );
103 void SetComment( const OUString& rComment )
104 { aEdComment->SetText( rComment ); }
106 void SetSizePixel( const Size& rNewSize ) SAL_OVERRIDE;
108 protected:
110 virtual void Paint( vcl::RenderContext& rRenderContext, const Rectangle& rRect ) SAL_OVERRIDE;
112 private:
113 VclPtr<ScScenarioListBox> aLbScenario;
114 VclPtr<MultiLineEdit> aEdComment;
117 // class ColumnEdit
119 class ColumnEdit : public SpinField
121 public:
122 ColumnEdit( ScNavigatorDlg* pParent, const ResId& rResId );
123 virtual ~ColumnEdit();
125 SCCOL GetCol() { return nCol; }
126 void SetCol( SCCOL nColNo );
128 protected:
129 virtual bool Notify( NotifyEvent& rNEvt ) SAL_OVERRIDE;
130 virtual void LoseFocus() SAL_OVERRIDE;
131 virtual void Up() SAL_OVERRIDE;
132 virtual void Down() SAL_OVERRIDE;
133 virtual void First() SAL_OVERRIDE;
134 virtual void Last() SAL_OVERRIDE;
136 private:
137 ScNavigatorDlg& rDlg;
138 SCCOL nCol;
139 sal_uInt16 nKeyGroup;
141 void EvalText ();
142 void ExecuteCol ();
143 static SCCOL AlphaToNum ( OUString& rStr );
144 static SCCOL NumStrToAlpha ( OUString& rStr );
145 static SCCOL NumToAlpha ( SCCOL nColNo, OUString& rStr );
148 // class RowEdit
150 class RowEdit : public NumericField
152 public:
153 RowEdit( ScNavigatorDlg* pParent, const ResId& rResId );
154 virtual ~RowEdit();
156 SCROW GetRow() { return (SCROW)GetValue(); }
157 void SetRow( SCROW nRow ){ SetValue( nRow ); }
159 protected:
160 virtual bool Notify( NotifyEvent& rNEvt ) SAL_OVERRIDE;
161 virtual void LoseFocus() SAL_OVERRIDE;
163 private:
164 ScNavigatorDlg& rDlg;
166 void ExecuteRow();
169 // class ScDocListBox
171 class ScDocListBox : public ListBox
173 public:
174 ScDocListBox( ScNavigatorDlg* pParent, const ResId& rResId );
175 virtual ~ScDocListBox();
177 protected:
178 virtual void Select() SAL_OVERRIDE;
180 private:
181 ScNavigatorDlg& rDlg;
184 // class CommandToolBox
186 class CommandToolBox : public ToolBox
188 public:
189 CommandToolBox( ScNavigatorDlg* pParent, const ResId& rResId );
190 virtual ~CommandToolBox();
192 void Select( sal_uInt16 nId );
193 void UpdateButtons();
194 void InitImageList();
196 virtual void DataChanged( const DataChangedEvent& rDCEvt ) SAL_OVERRIDE;
198 DECL_LINK_TYPED( ToolBoxDropdownClickHdl, ToolBox*, void );
200 protected:
201 virtual void Select() SAL_OVERRIDE;
202 virtual void Click() SAL_OVERRIDE;
204 private:
205 ScNavigatorDlg& rDlg;
208 // class ScNavigatorDlg
210 class ScNavigatorDlg : public vcl::Window, public SfxListener
212 friend class ScNavigatorControllerItem;
213 friend class ScNavigatorDialogWrapper;
214 friend class ColumnEdit;
215 friend class RowEdit;
216 friend class ScDocListBox;
217 friend class CommandToolBox;
218 friend class ScContentTree;
220 private:
221 SfxBindings& rBindings; // must be first member
223 ImageList aCmdImageList; // must be before aTbxCmd
224 VclPtr<FixedInfo> aFtCol;
225 VclPtr<ColumnEdit> aEdCol;
226 VclPtr<FixedInfo> aFtRow;
227 VclPtr<RowEdit> aEdRow;
228 VclPtr<CommandToolBox> aTbxCmd;
229 VclPtr<ScContentTree> aLbEntries;
230 VclPtr<ScScenarioWindow> aWndScenarios;
231 VclPtr<ScDocListBox> aLbDocuments;
233 Idle aContentIdle;
235 OUString aTitleBase;
236 OUString aStrDragMode;
237 OUString aStrDisplay;
238 OUString aStrActive;
239 OUString aStrNotActive;
240 OUString aStrHidden;
241 OUString aStrActiveWin;
243 SfxChildWindowContext* pContextWin;
244 Size aInitSize;
245 ScArea* pMarkArea;
246 ScViewData* pViewData;
248 long nBorderOffset;
249 long nListModeHeight;
250 long nInitListHeight;
251 NavListMode eListMode;
252 sal_uInt16 nDropMode;
253 SCCOL nCurCol;
254 SCROW nCurRow;
255 SCTAB nCurTab;
256 bool bFirstBig;
257 bool mbUseStyleSettingsBackground;
259 ScNavigatorControllerItem** ppBoundItems;
261 DECL_LINK_TYPED( TimeHdl, Idle*, void );
263 void DoResize();
265 SfxBindings& GetBindings()
266 { return rBindings; }
268 void SetCurrentCell( SCCOL nCol, SCROW Row );
269 void SetCurrentCellStr( const OUString& rName );
270 void SetCurrentTable( SCTAB nTab );
271 void SetCurrentTableStr( const OUString& rName );
272 void SetCurrentObject( const OUString& rName );
273 void SetCurrentDoc( const OUString& rDocName );
275 static ScTabViewShell* GetTabViewShell();
276 static ScNavigatorSettings* GetNavigatorSettings();
277 bool GetViewData();
279 void UpdateColumn ( const SCCOL* pCol = NULL );
280 void UpdateRow ( const SCROW* pRow = NULL );
281 void UpdateTable ( const SCTAB* pTab = NULL );
282 void UpdateAll ();
284 void GetDocNames(const OUString* pSelEntry = NULL);
286 void SetListMode ( NavListMode eMode, bool bSetSize = true );
287 void ShowList ( bool bShow, bool bSetSize );
288 void ShowScenarios ( bool bShow, bool bSetSize );
290 void SetDropMode(sal_uInt16 nNew);
291 sal_uInt16 GetDropMode() const { return nDropMode; }
293 const OUString& GetStrDragMode() const { return aStrDragMode; }
294 const OUString& GetStrDisplay() const { return aStrDisplay; }
296 void CheckDataArea ();
297 void MarkDataArea ();
298 void UnmarkDataArea ();
299 void StartOfDataArea ();
300 void EndOfDataArea ();
302 static void ReleaseFocus();
304 protected:
305 virtual void Resize() SAL_OVERRIDE;
306 virtual void Paint( vcl::RenderContext& rRenderContext, const Rectangle& rRect ) SAL_OVERRIDE;
307 void Resizing( Size& rSize );
309 public:
310 ScNavigatorDlg( SfxBindings* pB, SfxChildWindowContext* pCW, vcl::Window* pParent,
311 const bool bUseStyleSettingsBackground);
312 virtual ~ScNavigatorDlg();
313 virtual void dispose() SAL_OVERRIDE;
315 using Window::Notify;
316 virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) SAL_OVERRIDE;
318 virtual void DataChanged( const DataChangedEvent& rDCEvt ) SAL_OVERRIDE;
321 class ScNavigatorDialogWrapper: public SfxChildWindowContext
323 public:
324 ScNavigatorDialogWrapper( vcl::Window* pParent,
325 sal_uInt16 nId,
326 SfxBindings* pBindings,
327 SfxChildWinInfo* pInfo );
329 SFX_DECL_CHILDWINDOWCONTEXT(ScNavigatorDialogWrapper)
331 virtual void Resizing( Size& rSize ) SAL_OVERRIDE;
333 private:
334 VclPtr<ScNavigatorDlg> pNavigator;
337 #endif // INCLUDED_SC_SOURCE_UI_INC_NAVIPI_HXX
339 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */