xref: /trunk/main/sc/source/ui/view/tabvwsh.cxx (revision 0deba7fb)
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 // MARKER(update_precomp.py): autogen include statement, do not remove
25 #include "precompiled_sc.hxx"
26 
27 
28 
29 //------------------------------------------------------------------
30 // INCLUDE ---------------------------------------------------------------
31 
32 #include "scitems.hxx"
33 #include <svx/galbrws.hxx>
34 #include <svx/imapdlg.hxx>
35 #include <svl/srchitem.hxx>
36 #include <sfx2/templdlg.hxx>
37 #include <sfx2/objface.hxx>
38 #include <sfx2/viewfrm.hxx>
39 #include <sfx2/bindings.hxx>
40 #include <sfx2/app.hxx>
41 #include <sfx2/sidebar/SidebarChildWindow.hxx>
42 #include <avmedia/mediaplayer.hxx>
43 
44 //IAccessibility2 Implementation 2009-----
45 #include "cell.hxx"
46 #include "docoptio.hxx"
47 //-----IAccessibility2 Implementation 2009
48 
49 #include "tabvwsh.hxx"
50 #include "docsh.hxx"
51 #include "reffact.hxx"
52 #include "scresid.hxx"
53 #include "dwfunctr.hxx"
54 #include "sc.hrc"       // -> SID_TOOL_xxx
55 #include "drawattr.hxx" // -> SvxDrawToolItem
56 #include "spelldialog.hxx"
57 
58 
59 #define ScTabViewShell
60 #include "scslots.hxx"
61 
62 TYPEINIT2(ScTabViewShell,SfxViewShell,SfxListener);
63 
64 SFX_IMPL_INTERFACE(ScTabViewShell,SfxViewShell,ScResId(SCSTR_TABVIEWSHELL))
65 {
66 	SFX_OBJECTBAR_REGISTRATION( SFX_OBJECTBAR_TOOLS  | SFX_VISIBILITY_STANDARD |
67 								SFX_VISIBILITY_FULLSCREEN | SFX_VISIBILITY_SERVER,
68 								ScResId(RID_OBJECTBAR_TOOLS) );
69 
70 	SFX_CHILDWINDOW_REGISTRATION(FID_INPUTLINE_STATUS);
71 	SFX_CHILDWINDOW_REGISTRATION(SfxTemplateDialogWrapper::GetChildWindowId());
72 	SFX_CHILDWINDOW_CONTEXT_REGISTRATION(SID_NAVIGATOR);
73 	SFX_CHILDWINDOW_REGISTRATION(::sfx2::sidebar::SidebarChildWindow::GetChildWindowId());
74 	SFX_CHILDWINDOW_REGISTRATION(ScNameDlgWrapper::GetChildWindowId());
75 	SFX_CHILDWINDOW_REGISTRATION(ScSolverDlgWrapper::GetChildWindowId());
76     SFX_CHILDWINDOW_REGISTRATION(ScOptSolverDlgWrapper::GetChildWindowId());
77 	SFX_CHILDWINDOW_REGISTRATION(ScPivotLayoutWrapper::GetChildWindowId());
78 	SFX_CHILDWINDOW_REGISTRATION(ScTabOpDlgWrapper::GetChildWindowId());
79 	SFX_CHILDWINDOW_REGISTRATION(ScFilterDlgWrapper::GetChildWindowId());
80 	SFX_CHILDWINDOW_REGISTRATION(ScSpecialFilterDlgWrapper::GetChildWindowId());
81 	SFX_CHILDWINDOW_REGISTRATION(ScDbNameDlgWrapper::GetChildWindowId());
82 	SFX_CHILDWINDOW_REGISTRATION(ScConsolidateDlgWrapper::GetChildWindowId());
83 	SFX_CHILDWINDOW_REGISTRATION(ScPrintAreasDlgWrapper::GetChildWindowId());
84 	SFX_CHILDWINDOW_REGISTRATION(ScCondFormatDlgWrapper::GetChildWindowId());
85 	SFX_CHILDWINDOW_REGISTRATION(ScColRowNameRangesDlgWrapper::GetChildWindowId());
86 	SFX_CHILDWINDOW_REGISTRATION(ScFormulaDlgWrapper::GetChildWindowId());
87 	SFX_CHILDWINDOW_REGISTRATION(SvxIMapDlgChildWindow::GetChildWindowId());
88 	SFX_CHILDWINDOW_REGISTRATION(ScFunctionChildWindow::GetChildWindowId());
89 	SFX_CHILDWINDOW_REGISTRATION(ScFormulaDlgWrapper::GetChildWindowId());
90 	SFX_CHILDWINDOW_REGISTRATION(ScAcceptChgDlgWrapper::GetChildWindowId());
91 	SFX_CHILDWINDOW_REGISTRATION(ScHighlightChgDlgWrapper::GetChildWindowId());
92 	SFX_CHILDWINDOW_REGISTRATION(ScSimpleRefDlgWrapper::GetChildWindowId());
93 	SFX_CHILDWINDOW_REGISTRATION(SID_SEARCH_DLG);
94 	SFX_CHILDWINDOW_REGISTRATION(SID_HYPERLINK_DIALOG);
95 	SFX_CHILDWINDOW_REGISTRATION(GalleryChildWindow::GetChildWindowId());
96     SFX_CHILDWINDOW_REGISTRATION(ScSpellDialogChildWindow::GetChildWindowId());
97 	SFX_CHILDWINDOW_REGISTRATION( ::avmedia::MediaPlayer::GetChildWindowId() );
98 	SFX_CHILDWINDOW_REGISTRATION(ScValidityRefChildWin::GetChildWindowId());
99 }
100 
101 SFX_IMPL_NAMED_VIEWFACTORY( ScTabViewShell, "Default" )
102 {
103 	SFX_VIEW_REGISTRATION(ScDocShell);
104 }
105 
106 //------------------------------------------------------------------
107 
108 IMPL_LINK( ScTabViewShell, HtmlOptionsHdl, void*, EMPTYARG )
109 {
110 	// Invalidierung, falls blinkender Text erlaubt/verboten wurde
111     GetViewFrame()->GetBindings().Invalidate(SID_DRAW_TEXT_MARQUEE);
112     return 0;
113 }
114 
115 //IAccessibility2 Implementation 2009-----
116 rtl::OUString ScTabViewShell::GetFormula(ScAddress& rAddress)
117 {
118 	String sFormula;
119 	ScDocument* pDoc = GetViewData()->GetDocument();
120 	ScBaseCell* pCell = pDoc->GetCell(rAddress);
121 	if (pCell && pCell->GetCellType()==CELLTYPE_FORMULA)
122 	{
123 		static_cast<ScFormulaCell*>(pCell)->GetFormula(sFormula);
124 	}
125 	return sFormula;
126 }
127 //-----IAccessibility2 Implementation 2009
128 
129 
130 
131