update dev300-m58
[ooovba.git] / framework / source / inc / loadenv / targethelper.hxx
blobacb23113678c121a8a3f93b1c4b7cc36a0747025
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: targethelper.hxx,v $
10 * $Revision: 1.6.82.1 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef __FRAMEWORK_TARGETHELPER_HXX_
32 #define __FRAMEWORK_TARGETHELPER_HXX_
34 //_______________________________________________
35 // own includes
37 #include <sal/types.h>
38 #include <rtl/ustring.hxx>
39 #include <targets.h>
40 //_______________________________________________
41 // namespace
43 namespace framework{
45 //_______________________________________________
46 // definitions
48 /** @short can be used to detect, if a target name (used e.g. for XFrame.findFrame())
49 has a special meaning or can be used as normal frame name (e.g. for XFrame.setName()).
51 @author as96863
53 class TargetHelper
55 //___________________________________________
56 // const
58 public:
60 /** @short its used at the following interfaces to classify
61 target names.
63 enum ESpecialTarget
65 E_NOT_SPECIAL ,
66 E_SELF ,
67 E_PARENT ,
68 E_TOP ,
69 E_BLANK ,
70 E_DEFAULT ,
71 E_BEAMER ,
72 E_MENUBAR ,
73 E_HELPAGENT ,
74 E_HELPTASK
77 //___________________________________________
78 // interface
80 public:
82 //___________________________________________
84 /** @short it checks the given unknown target name,
85 if it's the expected special one.
87 @note An empty target is similar to "_self"!
89 @param sCheckTarget
90 must be the unknwon target name, which should be checked.
92 @param eSpecialTarget
93 represent the expected target.
95 @return It returns <TRUE/> if <var>sCheckTarget</var> represent
96 the expected <var>eSpecialTarget</var> value; <FALSE/> otherwhise.
98 static sal_Bool matchSpecialTarget(const ::rtl::OUString& sCheckTarget ,
99 ESpecialTarget eSpecialTarget);
101 //___________________________________________
103 /** @short it checks, if the given name can be used
104 to set it at a frame using XFrame.setName() method.
106 @descr Because we handle special targets in a hard coded way
107 (means we do not check the real name of a frame then)
108 such named frames will never be found!
110 And in case such special names can exists one times only
111 by definition inside the same frame tree (e.g. _beamer and
112 OFFICE_HELP_TASK) its not a good idea to allow anything here :-)
114 Of course we can't check unknwon names, which are not special ones.
115 But we decide, that it's not allowed to use "_" as first sign
116 (because we reserve this letter for our own purposes!)
117 and the value must not a well known special target.
119 @param sName
120 the new frame name, which sould be checked.
122 static sal_Bool isValidNameForFrame(const ::rtl::OUString& sName);
125 } // namespace framework
127 #endif // #ifndef __FRAMEWORK_TARGETHELPER_HXX_