Update ooo320-m1
[ooovba.git] / sd / source / ui / inc / ViewTabControl.hxx
blobf53f12cc270680c27dd5b5534608a386f9cb41fd
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: ViewTabControl.hxx,v $
10 * $Revision: 1.4 $
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 ************************************************************************/
31 #ifndef SD_TAB_CONTROL_HXX
32 #define SD_TAB_CONTROL_HXX
34 #include <svtools/tabbar.hxx>
35 #include <svtools/transfer.hxx>
37 namespace sd {
39 /*************************************************************************
41 |* TabControl-Klasse fuer Seitenumschaltung
43 \************************************************************************/
45 class DrawViewShell;
47 class TabControl
48 : public TabBar,
49 public DragSourceHelper,
50 public DropTargetHelper
52 public:
53 TabControl (DrawViewShell* pDrViewSh, ::Window* pParent);
54 virtual ~TabControl (void);
56 /** Inform all listeners of this control that the current page has been
57 activated. Call this method after switching the current page and is
58 not done elsewhere (like when using page up/down keys).
60 void SendActivatePageEvent (void);
62 /** Inform all listeners of this control that the current page has been
63 deactivated. Call this method before switching the current page and
64 is not done elsewhere (like when using page up/down keys).
66 void SendDeactivatePageEvent (void);
68 protected:
69 DrawViewShell* pDrViewSh;
70 BOOL bInternalMove;
72 // TabBar
73 virtual void Select();
74 virtual void DoubleClick();
75 virtual void MouseButtonDown(const MouseEvent& rMEvt);
77 virtual void Command(const CommandEvent& rCEvt);
79 virtual long StartRenaming();
80 virtual long AllowRenaming();
81 virtual void EndRenaming();
83 virtual void ActivatePage();
84 virtual long DeactivatePage();
86 // DragSourceHelper
87 virtual void StartDrag( sal_Int8 nAction, const Point& rPosPixel );
89 // DropTargetHelper
90 virtual sal_Int8 AcceptDrop( const AcceptDropEvent& rEvt );
91 virtual sal_Int8 ExecuteDrop( const ExecuteDropEvent& rEvt );
93 DECL_LINK(DeactivatePageHdl, void*);
95 private:
96 // nested class to implement the TransferableHelper
97 class TabControlTransferable : public TransferableHelper
99 public:
100 TabControlTransferable( TabControl& rParent ) :
101 mrParent( rParent ) {}
102 private:
104 TabControl& mrParent;
106 virtual ~TabControlTransferable();
108 virtual void AddSupportedFormats();
109 virtual sal_Bool GetData( const ::com::sun::star::datatransfer::DataFlavor& rFlavor );
110 virtual void DragFinished( sal_Int8 nDropAction );
114 friend class TabControl::TabControlTransferable;
116 void DragFinished( sal_Int8 nDropAction );
120 } // end of namespace sd
122 #endif