xref: /aoo4110/main/sc/source/ui/inc/tabcont.hxx (revision b1cdbd2c)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef SC_TABCONT_HXX
25 #define SC_TABCONT_HXX
26 
27 #include "address.hxx"
28 #include <svtools/tabbar.hxx>
29 #include <svtools/transfer.hxx>
30 
31 
32 class ScViewData;
33 
34 // ---------------------------------------------------------------------------
35 
36 //	initial size
37 #define SC_TABBAR_DEFWIDTH		270
38 
39 
40 class ScTabControl : public TabBar, public DropTargetHelper, public DragSourceHelper
41 {
42 private:
43 	ScViewData*		pViewData;
44     sal_uInt16          nMouseClickPageId;      /// Last page ID after mouse button down/up
45     sal_uInt16          nSelPageIdByMouse;      /// Selected page ID, if selected with mouse
46     sal_Bool            bErrorShown;
47 
48 	void    		DoDrag( const Region& rRegion );
49 
50 	sal_uInt16			GetMaxId() const;
51 	SCTAB			GetPrivatDropPos(const Point& rPos );
52 
53 protected:
54 	virtual void	Select();
55 	virtual void	Command( const CommandEvent& rCEvt );
56 	virtual void	MouseButtonDown( const MouseEvent& rMEvt );
57 	virtual void	MouseButtonUp( const MouseEvent& rMEvt );
58 
59 	virtual sal_Int8 AcceptDrop( const AcceptDropEvent& rEvt );
60 	virtual sal_Int8 ExecuteDrop( const ExecuteDropEvent& rEvt );
61 
62 	virtual void	StartDrag( sal_Int8 nAction, const Point& rPosPixel );
63 
64 	virtual	long	StartRenaming();
65 	virtual long	AllowRenaming();
66 	virtual void	EndRenaming();
67     virtual void    Mirror();
68 
69 public:
70 					ScTabControl( Window* pParent, ScViewData* pData );
71 					~ScTabControl();
72 
73     using TabBar::StartDrag;
74 
75 	void			UpdateStatus();
76 	void			ActivateView(sal_Bool bActivate);
77 
78     void            SetSheetLayoutRTL( sal_Bool bSheetRTL );
79 };
80 
81 
82 
83 #endif
84