1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
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/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
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 .
18  */
19 #pragma once
20 
21 #include "scriptdocument.hxx"
22 #include <svl/poolitem.hxx>
23 
24 namespace basctl
25 {
26 
27 enum ItemType
28 {
29     TYPE_UNKNOWN,
30     TYPE_SHELL,
31     TYPE_LIBRARY,
32     TYPE_MODULE,
33     TYPE_DIALOG,
34     TYPE_METHOD
35 };
36 
37 class SbxItem : public SfxPoolItem
38 {
39     const ScriptDocument    m_aDocument;
40     const OUString          m_aLibName;
41     const OUString          m_aName;
42     const OUString          m_aMethodName;
43     ItemType                m_eType;
44 
45 public:
46     static SfxPoolItem* CreateDefault();
47     SbxItem(sal_uInt16 nWhich, const ScriptDocument& rDocument, const OUString& aLibName, const OUString& aName, ItemType);
48     SbxItem(sal_uInt16 nWhich, const ScriptDocument& rDocument, const OUString& aLibName, const OUString& aName, const OUString& aMethodName, ItemType eType);
49 
50     virtual SbxItem* Clone(SfxItemPool *pPool = nullptr) const override;
51     virtual bool operator==(const SfxPoolItem&) const override;
52 
GetDocument() const53     ScriptDocument const& GetDocument () const { return m_aDocument; }
GetLibName() const54     OUString const& GetLibName () const { return m_aLibName; }
GetName() const55     OUString const& GetName () const { return m_aName; }
GetMethodName() const56     OUString const& GetMethodName () const { return m_aMethodName; }
GetType() const57     ItemType GetType () const { return m_eType; }
58 };
59 
60 } // namespace basctl
61 
62 // For baside.sdi, because I don't know how to use nested names in it.
63 using basctl::SbxItem;
64 
65 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
66