xref: /trunk/main/sfx2/inc/sfx2/viewfac.hxx (revision 353d8f4d)
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 #ifndef _VIEWFAC_HXX
24 #define _VIEWFAC_HXX
25 
26 #include "sal/config.h"
27 #include "sfx2/dllapi.h"
28 #include <tools/string.hxx>
29 #include <tools/resid.hxx>
30 
31 class SfxViewFrame;
32 class SfxViewShell;
33 class Window;
34 
35 typedef SfxViewShell* (*SfxViewCtor)(SfxViewFrame*, SfxViewShell*);
36 typedef void (*SfxViewInit)();
37 
38 // CLASS -----------------------------------------------------------------
39 class SFX2_DLLPUBLIC SfxViewFactory
40 {
41 public:
42 	SfxViewFactory( SfxViewCtor fnC, SfxViewInit fnI,
43 					sal_uInt16 nOrdinal, const sal_Char* asciiViewName );
44 	~SfxViewFactory();
45 
46 	SfxViewShell *CreateInstance(SfxViewFrame *pViewFrame, SfxViewShell *pOldSh);
47 	void		  InitFactory();
GetOrdinal() const48 	sal_uInt16		  GetOrdinal() const { return nOrd; }
49 
50     /// returns a legacy view name. This is "view" with an appended ordinal/ID.
51     String        GetLegacyViewName() const;
52 
53     /** returns a API-compatible view name.
54 
55         For details on which view names are specified, see the XModel2.getAvailableViewControllerNames
56         documentation.
57     */
58     String        GetAPIViewName() const;
59 
60 private:
61 	SfxViewCtor fnCreate;
62 	SfxViewInit fnInit;
63 	sal_uInt16      nOrd;
64     const String    m_sViewName;
65 };
66 
67 #endif
68 
69