fix baseline build (old cairo) - 'cairo_rectangle_int_t' does not name a type
[LibreOffice.git] / framework / inc / jobs / joburl.hxx
blobac816c3e3e1355ea54d933fa1e0e08654afd31da
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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
23 #include <stdtypes.h>
24 #include <general.h>
26 #include <rtl/ustring.hxx>
28 namespace framework{
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 ','
42 /**
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.
49 class JobURL
52 // types
54 private:
56 /**
57 possible states of a job URL
58 Note: These values are used in combination. So they must be
59 values in form 2^n.
61 enum ERequest
63 /// mark a job URL as not valid
64 E_UNKNOWN = 0,
65 /// it's an event
66 E_EVENT = 1,
67 /// it's an alias
68 E_ALIAS = 2,
69 /// it's a service
70 E_SERVICE = 4
73 // types
75 private:
77 /** knows the state of this URL instance */
78 sal_uInt32 m_eRequest;
80 /** holds the event part of a job URL */
81 OUString m_sEvent;
83 /** holds the alias part of a job URL */
84 OUString m_sAlias;
86 /** holds the service part of a job URL */
87 OUString m_sService;
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;
98 // native interface
100 public:
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;
108 // private helper
110 private:
112 static bool implst_split( const OUString& sPart ,
113 const sal_Char* pPartIdentifier ,
114 sal_Int32 nPartLength ,
115 OUString& rPartValue ,
116 OUString& rPartArguments );
118 // debug methods!
120 #ifdef ENABLE_COMPONENT_SELF_CHECK
122 public:
123 static void impldbg_checkIt();
125 private:
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: */