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.cxx,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 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_framework.hxx"
34 //_______________________________________________
37 #ifndef __FRAMEWORK_LOADENV_TARGETHELPER_HXX_
38 #include <loadenv/targethelper.hxx>
41 //_______________________________________________
46 //_______________________________________________
49 /*-----------------------------------------------
51 -----------------------------------------------*/
52 sal_Bool
TargetHelper::matchSpecialTarget(const ::rtl::OUString
& sCheckTarget
,
53 ESpecialTarget eSpecialTarget
)
55 switch(eSpecialTarget
)
59 (!sCheckTarget
.getLength() ) ||
60 (sCheckTarget
.equals(SPECIALTARGET_SELF
))
64 return (sCheckTarget
.equals(SPECIALTARGET_PARENT
));
67 return (sCheckTarget
.equals(SPECIALTARGET_TOP
));
70 return (sCheckTarget
.equals(SPECIALTARGET_BLANK
));
73 return (sCheckTarget
.equals(SPECIALTARGET_DEFAULT
));
76 return (sCheckTarget
.equals(SPECIALTARGET_BEAMER
));
79 return (sCheckTarget
.equals(SPECIALTARGET_MENUBAR
));
82 return (sCheckTarget
.equals(SPECIALTARGET_HELPAGENT
));
85 return (sCheckTarget
.equals(SPECIALTARGET_HELPTASK
));
93 /*-----------------------------------------------
95 -----------------------------------------------*/
96 sal_Bool
TargetHelper::isValidNameForFrame(const ::rtl::OUString
& sName
)
98 // some special targets are realy special ones :-)
99 // E.g. the are realy used to locate one frame inside the frame tree.
101 (!sName
.getLength() ) ||
102 (TargetHelper::matchSpecialTarget(sName
, E_HELPTASK
)) ||
103 (TargetHelper::matchSpecialTarget(sName
, E_BEAMER
) )
107 // all other names must be checked more general
108 // special targets starts with a "_".
109 return (sName
.indexOf('_') != 0);
112 } // namespace framework