LUACompleter.hxx 900 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /*
  2. * Copyright (c) Contributors to the Open 3D Engine Project.
  3. * For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. *
  5. * SPDX-License-Identifier: Apache-2.0 OR MIT
  6. *
  7. */
  8. #ifndef LUAEDITOR_LUACOMPLETER_H
  9. #define LUAEDITOR_LUACOMPLETER_H
  10. #if !defined(Q_MOC_RUN)
  11. #include <AzCore/base.h>
  12. #include <AzCore/Memory/SystemAllocator.h>
  13. #include <QCompleter>
  14. #endif
  15. #pragma once
  16. namespace LUAEditor
  17. {
  18. class Completer : public QCompleter
  19. {
  20. Q_OBJECT
  21. public:
  22. AZ_CLASS_ALLOCATOR(Completer, AZ::SystemAllocator);
  23. Completer(QAbstractItemModel* model, QObject* parent);
  24. virtual ~Completer();
  25. int GetCompletionPrefixTailLength();
  26. private:
  27. const char* c_luaSplit{R"([.:])"};
  28. QStringList splitPath(const QString & path) const override;
  29. QStringList m_keywords;
  30. };
  31. }
  32. #endif