File indexing completed on 2024-04-21 03:58:08

0001 /*
0002     SPDX-FileCopyrightText: 2008 Erlend Hamberg <ehamberg@gmail.com>
0003 
0004     SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #ifndef KATEVI_MOTION_H
0008 #define KATEVI_MOTION_H
0009 
0010 #include <vimode/command.h>
0011 #include <vimode/range.h>
0012 
0013 namespace KateVi
0014 {
0015 class NormalViMode;
0016 /**
0017  * combined class for motions and text objects. execute() returns a KateViRange.
0018  * For motions the returned range is only a position (start pos is (-1, -1) to
0019  * indicate this) for text objects a range (startx, starty), (endx, endy) is
0020  * returned
0021  */
0022 class Motion : public Command
0023 {
0024 public:
0025     Motion(const QString &pattern, Range (NormalViMode::*commandMethod)(), unsigned int flags = 0);
0026     Range execute(NormalViMode *mode) const;
0027 
0028 protected:
0029     Range (NormalViMode::*m_ptr2commandMethod)();
0030 };
0031 
0032 }
0033 
0034 #endif /* KATEVI_MOTION_H */