1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef INCLUDED_FRAMEWORK_INC_JOBS_JOBURL_HXX
21 #define INCLUDED_FRAMEWORK_INC_JOBS_JOBURL_HXX
26 #include <rtl/ustring.hxx>
30 #define JOBURL_EVENT_STR "event="
31 #define JOBURL_EVENT_LEN 6
33 #define JOBURL_ALIAS_STR "alias="
34 #define JOBURL_ALIAS_LEN 6
36 #define JOBURL_SERVICE_STR "service="
37 #define JOBURL_SERVICE_LEN 8
39 #define JOBURL_PART_SEPARATOR ';'
40 #define JOBURL_PARTARGS_SEPARATOR ','
43 @short can be used to parse, validate and work with job URL's
44 @descr Job URLs are specified by the following syntax:
45 vnd.sun.star.job:{[event=<name>]|[alias=<name>]|[service=<name>]}
46 This class can analyze this structure and separate it into his different parts.
47 After doing that these parts are accessible by the methods of this class.
57 possible states of a job URL
58 Note: These values are used in combination. So they must be
63 /// mark a job URL as not valid
77 /** knows the state of this URL instance */
78 sal_uInt32 m_eRequest
;
80 /** holds the event part of a job URL */
83 /** holds the alias part of a job URL */
86 /** holds the service part of a job URL */
89 /** holds the event arguments */
90 OUString m_sEventArgs
;
92 /** holds the alias arguments */
93 OUString m_sAliasArgs
;
95 /** holds the service arguments */
96 OUString m_sServiceArgs
;
102 JobURL ( const OUString
& sURL
);
103 bool isValid ( ) const;
104 bool getEvent ( OUString
& sEvent
) const;
105 bool getAlias ( OUString
& sAlias
) const;
106 bool getService ( OUString
& sService
) const;
112 static bool implst_split( const OUString
& sPart
,
113 const sal_Char
* pPartIdentifier
,
114 sal_Int32 nPartLength
,
115 OUString
& rPartValue
,
116 OUString
& rPartArguments
);
120 #ifdef ENABLE_COMPONENT_SELF_CHECK
123 static void impldbg_checkIt();
126 static void impldbg_checkURL( const sal_Char
* pURL
,
127 sal_uInt32 eExpectedPart
,
128 const sal_Char
* pExpectedEvent
,
129 const sal_Char
* pExpectedAlias
,
130 const sal_Char
* pExpectedService
,
131 const sal_Char
* pExpectedEventArgs
,
132 const sal_Char
* pExpectedAliasArgs
,
133 const sal_Char
* pExpectedServiceArgs
);
134 OUString
impldbg_toString() const;
136 sal_Bool
getServiceArgs( OUString
& sServiceArgs
) const;
137 sal_Bool
getEventArgs ( OUString
& sEventArgs
) const;
138 sal_Bool
getAliasArgs ( OUString
& sAliasArgs
) const;
140 #endif // ENABLE_COMPONENT_SELF_CHECK
143 } // namespace framework
145 #endif // INCLUDED_FRAMEWORK_INC_JOBS_JOBURL_HXX
147 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */