2021-07-08 16:07:03 -05:00
|
|
|
/*
|
|
|
|
* 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
|
|
|
|
|
2021-07-31 18:50:04 -05:00
|
|
|
#include <StringList.h>
|
|
|
|
#include <TextView.h>
|
2021-07-08 16:07:03 -05:00
|
|
|
|
|
|
|
#include "ConversationView.h"
|
|
|
|
|
|
|
|
|
2021-07-31 18:50:04 -05:00
|
|
|
class SendTextView : public BTextView {
|
2021-07-08 16:07:03 -05:00
|
|
|
public:
|
2021-07-31 20:18:36 -05:00
|
|
|
SendTextView(const char* name, ConversationView* convView);
|
2021-07-08 16:07:03 -05:00
|
|
|
|
2021-07-31 20:18:36 -05:00
|
|
|
virtual void KeyDown(const char* bytes, int32 numBytes);
|
2021-07-08 16:07:03 -05:00
|
|
|
|
|
|
|
private:
|
2021-07-31 20:18:36 -05:00
|
|
|
void _AutoComplete();
|
2021-08-11 12:07:11 -05:00
|
|
|
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();
|
2021-07-31 18:50:04 -05:00
|
|
|
|
2021-08-11 12:07:11 -05:00
|
|
|
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;
|
2021-08-11 12:07:11 -05:00
|
|
|
BStringList fCurrentList;
|
2021-07-31 18:50:04 -05:00
|
|
|
|
2021-07-31 20:18:36 -05:00
|
|
|
// Used for history
|
2021-07-31 18:50:04 -05:00
|
|
|
BStringList fHistory;
|
|
|
|
int32 fHistoryIndex;
|
2021-07-08 16:07:03 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // _SEND_TEXT_VIEW_H
|