Version 6.4.0.0.beta1, tag libreoffice-6.4.0.0.beta1
[LibreOffice.git] / cui / source / inc / pastedlg.hxx
blob565101d7fe19d59e9c0f3018dfd08870f6c02e8b
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_CUI_SOURCE_INC_PASTEDLG_HXX
21 #define INCLUDED_CUI_SOURCE_INC_PASTEDLG_HXX
23 #include <map>
24 #include <sot/formats.hxx>
25 #include <tools/globname.hxx>
26 #include <vcl/transfer.hxx>
27 #include <vcl/weld.hxx>
29 struct TransferableObjectDescriptor;
30 class TransferableDataHelper;
32 class SvPasteObjectDialog : public weld::GenericDialogController
34 std::map< SotClipboardFormatId, OUString > aSupplementMap;
35 SvGlobalName aObjClassName;
36 OUString aObjName;
38 std::unique_ptr<weld::Label> m_xFtObjectSource;
39 std::unique_ptr<weld::TreeView> m_xLbInsertList;
40 std::unique_ptr<weld::Button> m_xOKButton;
42 weld::TreeView& ObjectLB() { return *m_xLbInsertList; }
44 void SelectObject();
45 DECL_LINK(SelectHdl, weld::TreeView&, void);
46 DECL_LINK(DoubleClickHdl, weld::TreeView&, bool);
48 public:
49 SvPasteObjectDialog(weld::Window* pParent);
51 void Insert( SotClipboardFormatId nFormat, const OUString & rFormatName );
52 void SetObjName( const SvGlobalName & rClass, const OUString & rObjName );
53 /**
54 * @brief PreGetFormat Prepares the dialog for running to get format of paste as a SotClipboardFormatId value by calling GetFormatOnly()
55 * @param aHelper
57 void PreGetFormat( const TransferableDataHelper& aHelper);
58 /**
59 * @brief GetFormatOnly Returns a SotClipboardFormatId value. Should be called after actually running the dialog.
60 * @return
62 SotClipboardFormatId GetFormatOnly();
63 /**
64 * @brief GetFormat Prepares and runs the dialog, and returns a SotClipboardFormatId depending on the RET_OK result
65 * @param aHelper TransferableDataHelper containing the data to be pasted
66 * @return a SotClipboardFormatId value depending on the result of running the dialog
68 SotClipboardFormatId GetFormat( const TransferableDataHelper& aHelper);
71 #endif // INCLUDED_CUI_SOURCE_INC_PASTEDLG_HXX
73 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */