1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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_SVTOOLS_SOURCE_TABLE_MOUSEFUNCTION_HXX
21 #define INCLUDED_SVTOOLS_SOURCE_TABLE_MOUSEFUNCTION_HXX
23 #include "svtools/table/tabletypes.hxx"
25 #include <rtl/ref.hxx>
27 #include <boost/noncopyable.hpp>
31 //......................................................................................................................
32 namespace svt
{ namespace table
34 //......................................................................................................................
38 //==================================================================================================================
40 //==================================================================================================================
50 //==================================================================================================================
52 //==================================================================================================================
53 class IMouseFunction
: public ::rtl::IReference
, public ::boost::noncopyable
56 virtual FunctionResult
handleMouseMove( ITableControl
& i_tableControl
, MouseEvent
const & i_event
) = 0;
57 virtual FunctionResult
handleMouseDown( ITableControl
& i_tableControl
, MouseEvent
const & i_event
) = 0;
58 virtual FunctionResult
handleMouseUp( ITableControl
& i_tableControl
, MouseEvent
const & i_event
) = 0;
61 virtual ~IMouseFunction() { }
64 //==================================================================================================================
66 //==================================================================================================================
67 class MouseFunction
: public IMouseFunction
80 virtual oslInterlockedCount SAL_CALL
acquire();
81 virtual oslInterlockedCount SAL_CALL
release();
84 oslInterlockedCount m_refCount
;
87 //==================================================================================================================
89 //==================================================================================================================
90 class ColumnResize
: public MouseFunction
94 :m_nResizingColumn( COL_INVALID
)
100 virtual FunctionResult
handleMouseMove( ITableControl
& i_tableControl
, MouseEvent
const & i_event
);
101 virtual FunctionResult
handleMouseDown( ITableControl
& i_tableControl
, MouseEvent
const & i_event
);
102 virtual FunctionResult
handleMouseUp( ITableControl
& i_tableControl
, MouseEvent
const & i_event
);
105 ColPos m_nResizingColumn
;
108 //==================================================================================================================
110 //==================================================================================================================
111 class RowSelection
: public MouseFunction
121 virtual FunctionResult
handleMouseMove( ITableControl
& i_tableControl
, MouseEvent
const & i_event
);
122 virtual FunctionResult
handleMouseDown( ITableControl
& i_tableControl
, MouseEvent
const & i_event
);
123 virtual FunctionResult
handleMouseUp( ITableControl
& i_tableControl
, MouseEvent
const & i_event
);
129 //==================================================================================================================
130 //= ColumnSortHandler
131 //==================================================================================================================
132 class ColumnSortHandler
: public MouseFunction
136 :m_nActiveColumn( COL_INVALID
)
142 virtual FunctionResult
handleMouseMove( ITableControl
& i_tableControl
, MouseEvent
const & i_event
);
143 virtual FunctionResult
handleMouseDown( ITableControl
& i_tableControl
, MouseEvent
const & i_event
);
144 virtual FunctionResult
handleMouseUp( ITableControl
& i_tableControl
, MouseEvent
const & i_event
);
147 ColPos m_nActiveColumn
;
150 //......................................................................................................................
151 } } // namespace svt::table
152 //......................................................................................................................
154 #endif // INCLUDED_SVTOOLS_SOURCE_TABLE_MOUSEFUNCTION_HXX
156 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */