CWS-TOOLING: integrate CWS os150
[LibreOffice.git] / sd / source / ui / inc / TabControl.hxx
blob7334a6e89362ad15a1b5862403eea532d9043407
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org. If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
26 ************************************************************************/
28 #ifndef SD_TAB_CONTROL_HXX
29 #define SD_TAB_CONTROL_HXX
31 #include <svtools/tabbar.hxx>
32 #include <svtools/transfer.hxx>
34 namespace sd {
36 /*************************************************************************
38 |* TabControl-Klasse fuer Seitenumschaltung
40 \************************************************************************/
42 class DrawViewShell;
44 class TabControl
45 : public TabBar,
46 public DragSourceHelper,
47 public DropTargetHelper
49 public:
50 TabControl (DrawViewShell* pDrViewSh, ::Window* pParent);
51 virtual ~TabControl (void);
53 /** Inform all listeners of this control that the current page has been
54 activated. Call this method after switching the current page and is
55 not done elsewhere (like when using page up/down keys).
57 void SendActivatePageEvent (void);
59 /** Inform all listeners of this control that the current page has been
60 deactivated. Call this method before switching the current page and
61 is not done elsewhere (like when using page up/down keys).
63 void SendDeactivatePageEvent (void);
65 protected:
66 DrawViewShell* pDrViewSh;
67 sal_Bool bInternalMove;
69 // TabBar
70 virtual void Select();
71 virtual void DoubleClick();
72 virtual void MouseButtonDown(const MouseEvent& rMEvt);
74 virtual void Command(const CommandEvent& rCEvt);
76 virtual long StartRenaming();
77 virtual long AllowRenaming();
78 virtual void EndRenaming();
80 virtual void ActivatePage();
81 virtual long DeactivatePage();
83 // DragSourceHelper
84 virtual void StartDrag( sal_Int8 nAction, const Point& rPosPixel );
86 // DropTargetHelper
87 virtual sal_Int8 AcceptDrop( const AcceptDropEvent& rEvt );
88 virtual sal_Int8 ExecuteDrop( const ExecuteDropEvent& rEvt );
90 DECL_LINK(DeactivatePageHdl, void*);
92 private:
93 // nested class to implement the TransferableHelper
94 class TabControlTransferable : public TransferableHelper
96 public:
97 TabControlTransferable( TabControl& rParent ) :
98 mrParent( rParent ) {}
99 private:
101 TabControl& mrParent;
103 virtual ~TabControlTransferable();
105 virtual void AddSupportedFormats();
106 virtual sal_Bool GetData( const ::com::sun::star::datatransfer::DataFlavor& rFlavor );
107 virtual void DragFinished( sal_Int8 nDropAction );
111 friend class TabControl::TabControlTransferable;
113 void DragFinished( sal_Int8 nDropAction );
115 private:
116 using TabBar::StartDrag;
119 } // end of namespace sd
121 #endif