xref: /aoo41x/main/sc/source/ui/inc/tabcont.hxx (revision cdf0e10c)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
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.
14  *
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).
20  *
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.
25  *
26  ************************************************************************/
27 
28 #ifndef SC_TABCONT_HXX
29 #define SC_TABCONT_HXX
30 
31 #include "address.hxx"
32 #include <svtools/tabbar.hxx>
33 #include <svtools/transfer.hxx>
34 
35 
36 class ScViewData;
37 
38 // ---------------------------------------------------------------------------
39 
40 //	initial size
41 #define SC_TABBAR_DEFWIDTH		270
42 
43 
44 class ScTabControl : public TabBar, public DropTargetHelper, public DragSourceHelper
45 {
46 private:
47 	ScViewData*		pViewData;
48     sal_uInt16          nMouseClickPageId;      /// Last page ID after mouse button down/up
49     sal_uInt16          nSelPageIdByMouse;      /// Selected page ID, if selected with mouse
50     sal_Bool            bErrorShown;
51 
52 	void    		DoDrag( const Region& rRegion );
53 
54 	sal_uInt16			GetMaxId() const;
55 	SCTAB			GetPrivatDropPos(const Point& rPos );
56 
57 protected:
58 	virtual void	Select();
59 	virtual void	Command( const CommandEvent& rCEvt );
60 	virtual void	MouseButtonDown( const MouseEvent& rMEvt );
61 	virtual void	MouseButtonUp( const MouseEvent& rMEvt );
62 
63 	virtual sal_Int8 AcceptDrop( const AcceptDropEvent& rEvt );
64 	virtual sal_Int8 ExecuteDrop( const ExecuteDropEvent& rEvt );
65 
66 	virtual void	StartDrag( sal_Int8 nAction, const Point& rPosPixel );
67 
68 	virtual	long	StartRenaming();
69 	virtual long	AllowRenaming();
70 	virtual void	EndRenaming();
71     virtual void    Mirror();
72 
73 public:
74 					ScTabControl( Window* pParent, ScViewData* pData );
75 					~ScTabControl();
76 
77     using TabBar::StartDrag;
78 
79 	void			UpdateStatus();
80 	void			ActivateView(sal_Bool bActivate);
81 
82     void            SetSheetLayoutRTL( sal_Bool bSheetRTL );
83 };
84 
85 
86 
87 #endif
88