File indexing completed on 2024-04-14 15:05:39

0001 /*
0002  * This file is part of TelepathyLoggerQt
0003  *
0004  * Copyright (C) 2013 Dan Vrátil <dvratil@redhat.com>
0005  *
0006  * This library is free software; you can redistribute it and/or modify
0007  * it under the terms of the GNU Lesser General Public License as published
0008  * by the Free Software Foundation; either version 2.1 of the License, or
0009  * (at your option) any later version.
0010  *
0011  * This program is distributed in the hope that it will be useful,
0012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0014  * GNU General Public License for more details.
0015  *
0016  * You should have received a copy of the GNU Lesser General Public License
0017  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
0018  */
0019 
0020 #include "log-walker.h"
0021 #include "types.h"
0022 #include "pending-events.h"
0023 #include "pending-log-walker-operation.h"
0024 
0025 #include <telepathy-logger/log-walker.h>
0026 
0027 using namespace Tpl;
0028 
0029 bool LogWalker::isStart()
0030 {
0031     return tpl_log_walker_is_start(object<TplLogWalker>());
0032 }
0033 
0034 bool LogWalker::isEnd()
0035 {
0036     return tpl_log_walker_is_end(object<TplLogWalker>());
0037 }
0038 
0039 PendingEvents* LogWalker::queryEvents(uint numEvents)
0040 {
0041     return new PendingEvents(LogWalkerPtr(this), numEvents);
0042 }
0043 
0044 PendingOperation* LogWalker::rewind(uint numEvents)
0045 {
0046     return new PendingLogWalkerOperation(LogWalkerPtr(this), PendingLogWalkerOperation::Rewind, numEvents);
0047 }