| 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 <vcl/window.hxx> |
| 22 |
|
| 23 |
namespace chart |
| 24 |
{ |
| 25 |
|
| 26 |
class ChartController; |
| 27 |
|
| 28 |
/** The ChartWindow collects events from the window and forwards them the to the controller |
| 29 |
thus the controller can perform appropriate actions |
| 30 |
*/ |
| 31 |
|
| 32 |
class ChartWindow final : public vcl::Window |
| 33 |
{ |
| 34 |
public: |
| 35 |
ChartWindow( ChartController* pController, vcl::Window* pParent, WinBits nStyle ); |
| 36 |
virtual ~ChartWindow() override; |
| 37 |
virtual void dispose() override; |
| 38 |
|
| 39 |
//from base class Window: |
| 40 |
virtual void PrePaint(vcl::RenderContext& rRenderContext) override; |
| 41 |
virtual void Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect) override; |
| 42 |
virtual void MouseButtonDown( const MouseEvent& rMEvt ) override; |
| 43 |
virtual void MouseMove( const MouseEvent& rMEvt ) override; |
| 44 |
virtual void Tracking( const TrackingEvent& rTEvt ) override; |
| 45 |
virtual void MouseButtonUp( const MouseEvent& rMEvt ) override; |
| 46 |
virtual void Resize() override; |
| 47 |
virtual void Activate() override; |
| 48 |
virtual void Deactivate() override; |
| 49 |
virtual void GetFocus() override; |
| 50 |
virtual void LoseFocus() override; |
| 51 |
virtual void Command( const CommandEvent& rCEvt ) override; |
| 52 |
virtual void KeyInput( const KeyEvent& rKEvt ) override; |
| 53 |
virtual void DataChanged( const DataChangedEvent& rDCEvt ) override; |
| 54 |
virtual void RequestHelp( const HelpEvent& rHEvt ) override; |
| 55 |
|
| 56 |
void ForceInvalidate(); |
| 57 |
virtual void ImplInvalidate( const vcl::Region* rRegion, InvalidateFlags nFlags ) override; |
| 58 |
/// Notify the LOK client about an invalidated area. |
| 59 |
virtual void LogicInvalidate( const tools::Rectangle* pRectangle ) override; |
| 60 |
|
| 61 |
virtual rtl::Reference<comphelper::OAccessible> CreateAccessible() override; |
| 62 |
|
| 63 |
virtual FactoryFunction GetUITestFactory() const override; |
| 64 |
|
| 65 |
ChartController* GetController(); |
| 66 |
|
| 67 |
virtual bool IsChart() const override { return true; } |
| 68 |
vcl::Window* GetParentEditWin(); |
| 69 |
|
| 70 |
private: |
| 71 |
// returns the chart bounding box in twips |
| 72 |
tools::Rectangle GetBoundingBox(); |
| 73 |
|
| 74 |
private: |
| 75 |
ChartController* m_pWindowController; |
| 76 |
bool m_bInPaint; |
| 77 |
VclPtr<vcl::Window> m_pViewShellWindow; |
| 78 |
|
| 79 |
void adjustHighContrastMode(); |
| 80 |
}; |
| 81 |
|
| 82 |
} //namespace chart |
| 83 |
|
| 84 |
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |