Hey Hai,
I'm gonna reply to this one in 2 parts. The first one is in answer to your first question. In order to get a list of jobs "pre-filtered" at the supervisor, you must create a QbQuery object with a filter attached to it.
If you're already familiar with binding to our libraries, then the following snippit will be useful:
QbQuery query;
// we need to grab the current time.
QbTime now;
now.setToNow();
// create a new time filter
QbFilter *timeFilter = QB_NULL;
timeFilter = new QbFilter("timecomplete", '>', now.value() - QB_TIME_WEEK);
// add filter to the query
query.filters().push(timeFilter);
/*
we pass the query object into the qbjobinfo routine and
the result if successful will be placed in the 'jobs' object.
we return a QB_TRUE on success and QB_FALSE on an error.
*/
QbJobList jobs;
if (!qbjobinfo(query, jobs)) {
cout << "ERROR: couldn't obtain data from supervisor." << endl;
exit(1);
}