tdf#130857 qt weld: Implement QtInstanceWidget::strip_mnemonic
[LibreOffice.git] / framework / inc / jobs / joburl.hxx
blob23486ec2f4d9eca10a3c0ade554d099a5c433130
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 #pragma once
22 #include <rtl/ustring.hxx>
24 namespace framework{
26 #define JOBURL_EVENT_STR "event="
27 #define JOBURL_EVENT_LEN 6
29 #define JOBURL_ALIAS_STR "alias="
30 #define JOBURL_ALIAS_LEN 6
32 #define JOBURL_SERVICE_STR "service="
33 #define JOBURL_SERVICE_LEN 8
35 #define JOBURL_PART_SEPARATOR ';'
36 #define JOBURL_PARTARGS_SEPARATOR ','
38 /**
39 @short can be used to parse, validate and work with job URL's
40 @descr Job URLs are specified by the following syntax:
41 vnd.sun.star.job:{[event=<name>]|[alias=<name>]|[service=<name>]}
42 This class can analyze this structure and separate it into his different parts.
43 After doing that these parts are accessible by the methods of this class.
45 class JobURL
48 // types
50 private:
52 /**
53 possible states of a job URL
54 Note: These values are used in combination. So they must be
55 values in form 2^n.
57 enum ERequest
59 /// mark a job URL as not valid
60 E_UNKNOWN = 0,
61 /// it's an event
62 E_EVENT = 1,
63 /// it's an alias
64 E_ALIAS = 2,
65 /// it's a service
66 E_SERVICE = 4
69 // types
71 private:
73 /** knows the state of this URL instance */
74 sal_uInt32 m_eRequest;
76 /** holds the event part of a job URL */
77 OUString m_sEvent;
79 /** holds the alias part of a job URL */
80 OUString m_sAlias;
82 /** holds the service part of a job URL */
83 OUString m_sService;
85 // native interface
87 public:
89 JobURL ( const OUString& sURL );
90 bool isValid ( ) const;
91 bool getEvent ( OUString& sEvent ) const;
92 bool getAlias ( OUString& sAlias ) const;
93 bool getService ( OUString& sService ) const;
95 // private helper
97 private:
99 static bool implst_split( std::u16string_view sPart ,
100 const char* pPartIdentifier ,
101 sal_Int32 nPartLength ,
102 OUString& rPartValue ,
103 OUString& rPartArguments );
106 } // namespace framework
108 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */