1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
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 //_______________________________________________
37 #include <sal/types.h>
38 #include <rtl/ustring.hxx>
40 //_______________________________________________
45 //_______________________________________________
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()).
55 //___________________________________________
60 /** @short its used at the following interfaces to classify
77 //___________________________________________
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"!
90 must be the unknwon target name, which should be checked.
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.
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_