Chat-O-Matic/application/views/SendTextView.h

44 lines
900 B
C
Raw Normal View History

/*
* Copyright 2021, Jaidyn Levesque <jadedctrl@teknik.io>
* All rights reserved. Distributed under the terms of the MIT license.
*/
#ifndef _SEND_TEXT_VIEW_H
#define _SEND_TEXT_VIEW_H
#include <StringList.h>
#include <TextView.h>
#include "ConversationView.h"
class SendTextView : public BTextView {
public:
2021-07-31 20:18:36 -05:00
SendTextView(const char* name, ConversationView* convView);
2021-07-31 20:18:36 -05:00
virtual void KeyDown(const char* bytes, int32 numBytes);
private:
2021-07-31 20:18:36 -05:00
void _AutoComplete();
BString _NextMatch(BStringList list, BString current);
BStringList _CommandNames();
BStringList _UserNames();
2021-07-09 10:39:48 -05:00
2021-07-31 20:18:36 -05:00
void _AppendHistory();
void _UpHistory();
void _DownHistory();
ConversationView* fChatView;
2021-07-09 10:39:48 -05:00
2021-07-31 20:18:36 -05:00
// Used for auto-completion
2021-07-09 10:39:48 -05:00
int32 fCurrentIndex;
BString fCurrentWord;
BStringList fCurrentList;
2021-07-31 20:18:36 -05:00
// Used for history
BStringList fHistory;
int32 fHistoryIndex;
};
#endif // _SEND_TEXT_VIEW_H