LibreOffice Module sc (master)  1
editsh.hxx
Go to the documentation of this file.
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 
20 #pragma once
21 
22 #include <sfx2/shell.hxx>
23 #include <tools/link.hxx>
24 #include <rtl/ref.hxx>
25 
26 #include <shellids.hxx>
27 
28 class SfxModule;
29 class EditView;
30 class ScViewData;
31 class ScInputHandler;
32 class SvxURLField;
35 
36 class ScEditShell final : public SfxShell
37 {
38 private:
44 
45  // tdf#140361 at context menu popup time set if the EditHyperlink entry
46  // should be disabled and use that state if queried about it if
47  // EditHyperlink is dispatched from the menu. So ignoring where the mouse
48  // currently happens to be when the menu was dismissed.
50 
51  const SvxURLField* GetURLField();
53 
54  DECL_LINK( ClipboardChanged, TransferableDataHelper*, void );
55 
56 public:
58 
59 private:
62 
63 public:
64  ScEditShell(EditView* pView, ScViewData& rData);
65  virtual ~ScEditShell() override;
66 
67  void SetEditView(EditView* pView);
69 
70  void Execute(SfxRequest& rReq);
71  void ExecuteTrans(const SfxRequest& rReq);
72  void GetState(SfxItemSet &rSet);
73  void GetClipState(SfxItemSet& rSet);
74 
75  void ExecuteAttr(SfxRequest& rReq);
76  void GetAttrState(SfxItemSet &rSet);
77 
78  void ExecuteUndo(const SfxRequest& rReq);
79  void GetUndoState(SfxItemSet &rSet);
80 
81  OUString GetSelectionText( bool bWholeWord );
82 
84  bool ShouldDisableEditHyperlink() const;
87  void EnableEditHyperlink();
88 };
89 
90 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
ScInputHandler * GetMyInputHdl()
Definition: editsh.cxx:115
const SvxURLField * GetURLField()
Definition: editsh.cxx:845
void Execute(SfxRequest &rReq)
Definition: editsh.cxx:157
DECL_LINK(ClipboardChanged, TransferableDataHelper *, void)
EditView * GetEditView()
Definition: editsh.hxx:68
void GetUndoState(SfxItemSet &rSet)
Definition: editsh.cxx:1314
void SetEditView(EditView *pView)
Definition: editsh.cxx:120
OUString GetSelectionText(bool bWholeWord)
Definition: editsh.cxx:1240
bool bPastePossible
Definition: editsh.hxx:42
std::optional< bool > moAtContextMenu_DisableEditHyperlink
Definition: editsh.hxx:49
#define SCID_EDIT_SHELL
Definition: shellids.hxx:27
void ExecuteTrans(const SfxRequest &rReq)
Definition: editsh.cxx:1345
bool bIsInsertMode
Definition: editsh.hxx:43
void GetClipState(SfxItemSet &rSet)
Definition: editsh.cxx:872
#define static
Definition: arraysum.hxx:27
void ExecuteAttr(SfxRequest &rReq)
Definition: editsh.cxx:933
void EnableEditHyperlink()
force "Edit Hyperlink" to true, with the expectation that SID_EDIT_HYPERLINK is later Invalidated to ...
Definition: editsh.cxx:718
bool ShouldDisableEditHyperlink() const
return true if "Edit Hyperlink" in context menu should be disabled
Definition: editsh.cxx:713
ScViewData & rViewData
Definition: editsh.hxx:40
void GetAttrState(SfxItemSet &rSet)
Definition: editsh.cxx:1168
rtl::Reference< TransferableClipboardListener > mxClipEvtLstnr
Definition: editsh.hxx:41
void ExecuteUndo(const SfxRequest &rReq)
Definition: editsh.cxx:1265
static void InitInterface_Impl()
SfxInterface initializer.
Definition: editsh.cxx:86
void GetState(SfxItemSet &rSet)
Definition: editsh.cxx:723
EditView * pEditView
Definition: editsh.hxx:39
#define SFX_DECL_INTERFACE(nId)