android: Update app-specific/MIME type icons
[LibreOffice.git] / cui / source / inc / pastedlg.hxx
blob72f7911f2c7765909377adee8e9fe2825c5a550e
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 <map>
23 #include <sot/formats.hxx>
24 #include <tools/globname.hxx>
25 #include <vcl/transfer.hxx>
26 #include <vcl/weld.hxx>
28 struct TransferableObjectDescriptor;
29 class TransferableDataHelper;
31 class SvPasteObjectDialog : public weld::GenericDialogController
33 std::map< SotClipboardFormatId, OUString > aSupplementMap;
34 // Additional UNO command to be displayed along the supported paste formats
35 std::pair<OUString, OUString> aExtraCommand;
36 SvGlobalName aObjClassName;
37 OUString aObjName;
39 std::unique_ptr<weld::Label> m_xFtObjectSource;
40 std::unique_ptr<weld::TreeView> m_xLbInsertList;
41 std::unique_ptr<weld::Button> m_xOKButton;
43 weld::TreeView& ObjectLB() { return *m_xLbInsertList; }
45 void SelectObject();
46 DECL_LINK(SelectHdl, weld::TreeView&, void);
47 DECL_LINK(DoubleClickHdl, weld::TreeView&, bool);
49 public:
50 SvPasteObjectDialog(weld::Window* pParent);
52 void Insert( SotClipboardFormatId nFormat, const OUString & rFormatName );
53 void InsertUno( const OUString& sUnoCmd, const OUString& sLabel);
54 void SetObjName( const SvGlobalName & rClass, const OUString & rObjName );
55 /**
56 * @brief PreGetFormat Prepares the dialog for running to get format of paste as a SotClipboardFormatId value by calling GetFormatOnly()
57 * @param aHelper
59 void PreGetFormat( const TransferableDataHelper& aHelper);
60 /**
61 * @brief GetFormatOnly Returns a SotClipboardFormatId value. Should be called after actually running the dialog.
62 * @return
64 SotClipboardFormatId GetFormatOnly();
65 /**
66 * @brief GetFormat Prepares and runs the dialog, and returns a SotClipboardFormatId depending on the RET_OK result
67 * @param aHelper TransferableDataHelper containing the data to be pasted
68 * @return a SotClipboardFormatId value depending on the result of running the dialog
70 SotClipboardFormatId GetFormat( const TransferableDataHelper& aHelper);
73 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */