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>
36 /*************************************************************************
38 |* TabControl-Klasse fuer Seitenumschaltung
40 \************************************************************************/
46 public DragSourceHelper
,
47 public DropTargetHelper
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);
66 DrawViewShell
* pDrViewSh
;
67 sal_Bool bInternalMove
;
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();
84 virtual void StartDrag( sal_Int8 nAction
, const Point
& rPosPixel
);
87 virtual sal_Int8
AcceptDrop( const AcceptDropEvent
& rEvt
);
88 virtual sal_Int8
ExecuteDrop( const ExecuteDropEvent
& rEvt
);
90 DECL_LINK(DeactivatePageHdl
, void*);
93 // nested class to implement the TransferableHelper
94 class TabControlTransferable
: public TransferableHelper
97 TabControlTransferable( TabControl
& rParent
) :
98 mrParent( rParent
) {}
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
);
116 using TabBar::StartDrag
;
119 } // end of namespace sd