Update ooo320-m1
[ooovba.git] / scripting / source / storage / ScriptURI.hxx
blobbb686428fa27de09b4527c6619a6ad2d02de4ea6
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: ScriptURI.hxx,v $
10 * $Revision: 1.5 $
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_STORAGE_SCRIPTURI_HXX_
32 #define __FRAMEWORK_STORAGE_SCRIPTURI_HXX_
34 #include <osl/mutex.hxx>
35 #include <rtl/ustring>
37 #include <com/sun/star/lang/IllegalArgumentException.hpp>
39 namespace scripting_impl {
40 // for simplification
41 #define css ::com::sun::star
42 #define dcsssf ::drafts::com::sun::star::script::framework
44 struct Uri {
45 bool valid;
46 ::rtl::OUString uri;
47 ::rtl::OUString location;
48 ::rtl::OUString language;
49 ::rtl::OUString functionName;
50 ::rtl::OUString logicalName;
52 /**
53 * Helper class for dealing with script URIs.
55 class ScriptURI
57 public:
58 ScriptURI( const ::rtl::OUString& scriptURI )
59 throw ( css::lang::IllegalArgumentException );
60 virtual ~ScriptURI() SAL_THROW ( () );
62 /**
63 * This function returns the location of the script
66 virtual ::rtl::OUString getLocation();
68 /**
69 * This function returns the language of the script, eg. java,
70 * StarBasic,...
73 virtual ::rtl::OUString getLanguage();
75 /**
76 * This function returns the language dependent function name of
77 * the script
79 virtual ::rtl::OUString getFunctionName();
81 /**
82 * This function returns the language independent logical name of
83 * the script
85 virtual ::rtl::OUString getLogicalName();
87 /**
88 * This function returns the full URI
91 virtual ::rtl::OUString getURI();
93 private:
94 ::osl::Mutex m_mutex;
96 /** @internal */
97 sal_Bool m_valid;
99 //the private strings
100 /** the string representation of the this objects URI */
101 ::rtl::OUString m_uri;
102 /** the location of the script referred to by this URI */
103 ::rtl::OUString m_location;
104 /** the language of the script referred to by this URI */
105 ::rtl::OUString m_language;
106 /** the language dependent function name of the script referred to by this URI */
107 ::rtl::OUString m_functionName;
108 /** the language independent logical name of the script referred to by this URI */
109 ::rtl::OUString m_logicalName;
111 //attempt to parse the URI provided
112 /** @internal */
113 Uri parseIt();
114 //set the members
115 /** @internal */
116 void set_values( Uri );
117 bool isValid();
119 ; // class ScriptURI
121 } //namespace script_uri
123 #endif // define __FRAMEWORK_STORAGE_SCRIPTURI_HXX_